// Copyright 2022 Luca Casonato. All rights reserved. MIT license.
/**
 * Database Center API Client for Deno
 * ===================================
 * 
 * Database Center offers a comprehensive, organization-wide platform for monitoring database fleet health across various products. It simplifies management and reduces risk by automatically aggregating and summarizing key health signals, removing the need for custom dashboards. The platform provides a unified view through its dashboard and API, enabling teams focused on reliability, compliance, security, cost, and administration to quickly identify and address relevant issues within their database fleets. 
 * 
 * Docs: https://docs.cloud.google.com/database-center/docs/overview
 * Source: https://googleapis.deno.dev/v1/databasecenter:v1beta.ts
 */

import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts";
export { auth, GoogleAuth };
export type { CredentialsClient };

/**
 * Database Center offers a comprehensive, organization-wide platform for
 * monitoring database fleet health across various products. It simplifies
 * management and reduces risk by automatically aggregating and summarizing key
 * health signals, removing the need for custom dashboards. The platform
 * provides a unified view through its dashboard and API, enabling teams focused
 * on reliability, compliance, security, cost, and administration to quickly
 * identify and address relevant issues within their database fleets.
 */
export class DatabaseCenter {
  #client: CredentialsClient | undefined;
  #baseUrl: string;

  constructor(client?: CredentialsClient, baseUrl: string = "https://databasecenter.googleapis.com/") {
    this.#client = client;
    this.#baseUrl = baseUrl;
  }

  /**
   * AggregateQueryStats provides database resource query execution statistics.
   *
   * @param parent Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the `parent`. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  async foldersAggregateQueryStats(parent: string, req: AggregateQueryStatsRequest): Promise<AggregateQueryStatsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta/${ parent }:aggregateQueryStats`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return deserializeAggregateQueryStatsResponse(data);
  }

  /**
   * AggregateQueryStats provides database resource query execution statistics.
   *
   * @param parent Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the `parent`. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  async organizationsAggregateQueryStats(parent: string, req: AggregateQueryStatsRequest): Promise<AggregateQueryStatsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta/${ parent }:aggregateQueryStats`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return deserializeAggregateQueryStatsResponse(data);
  }

  /**
   * AggregateQueryStats provides database resource query execution statistics.
   *
   * @param parent Required. Parent can be a project, a folder, or an organization. The search is limited to the resources within the `parent`. The allowed values are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  async projectsAggregateQueryStats(parent: string, req: AggregateQueryStatsRequest): Promise<AggregateQueryStatsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta/${ parent }:aggregateQueryStats`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return deserializeAggregateQueryStatsResponse(data);
  }

  /**
   * AggregateFleet provides statistics about the fleet grouped by various
   * fields.
   *
   */
  async v1betaAggregateFleet(opts: V1betaAggregateFleetOptions = {}): Promise<AggregateFleetResponse> {
    const url = new URL(`${this.#baseUrl}v1beta:aggregateFleet`);
    if (opts["baselineDate.day"] !== undefined) {
      url.searchParams.append("baselineDate.day", String(opts["baselineDate.day"]));
    }
    if (opts["baselineDate.month"] !== undefined) {
      url.searchParams.append("baselineDate.month", String(opts["baselineDate.month"]));
    }
    if (opts["baselineDate.year"] !== undefined) {
      url.searchParams.append("baselineDate.year", String(opts["baselineDate.year"]));
    }
    if (opts.filter !== undefined) {
      url.searchParams.append("filter", String(opts.filter));
    }
    if (opts.groupBy !== undefined) {
      url.searchParams.append("groupBy", String(opts.groupBy));
    }
    if (opts.orderBy !== undefined) {
      url.searchParams.append("orderBy", String(opts.orderBy));
    }
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    if (opts.parent !== undefined) {
      url.searchParams.append("parent", String(opts.parent));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as AggregateFleetResponse;
  }

  /**
   * AggregateIssueStats provides database resource issues statistics.
   *
   */
  async v1betaAggregateIssueStats(req: AggregateIssueStatsRequest): Promise<AggregateIssueStatsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta:aggregateIssueStats`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return data as AggregateIssueStatsResponse;
  }

  /**
   * QueryDatabaseResourceGroups returns paginated results of database groups.
   *
   */
  async v1betaQueryDatabaseResourceGroups(req: QueryDatabaseResourceGroupsRequest): Promise<QueryDatabaseResourceGroupsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta:queryDatabaseResourceGroups`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return deserializeQueryDatabaseResourceGroupsResponse(data);
  }

  /**
   * QueryIssues provides a list of issues and recommendations that a user has
   * access to and that are within the requested scope.
   *
   */
  async v1betaQueryIssues(req: QueryIssuesRequest): Promise<QueryIssuesResponse> {
    const url = new URL(`${this.#baseUrl}v1beta:queryIssues`);
    const body = JSON.stringify(req);
    const data = await request(url.href, {
      client: this.#client,
      method: "POST",
      body,
    });
    return deserializeQueryIssuesResponse(data);
  }

  /**
   * QueryProducts provides a list of all possible products which can be used
   * to filter database resources.
   *
   */
  async v1betaQueryProducts(opts: V1betaQueryProductsOptions = {}): Promise<QueryProductsResponse> {
    const url = new URL(`${this.#baseUrl}v1beta:queryProducts`);
    if (opts.pageSize !== undefined) {
      url.searchParams.append("pageSize", String(opts.pageSize));
    }
    if (opts.pageToken !== undefined) {
      url.searchParams.append("pageToken", String(opts.pageToken));
    }
    if (opts.parent !== undefined) {
      url.searchParams.append("parent", String(opts.parent));
    }
    const data = await request(url.href, {
      client: this.#client,
      method: "GET",
    });
    return data as QueryProductsResponse;
  }
}

/**
 * Details related to signal.
 */
export interface AdditionalDetail {
  /**
   * Automated backup policy information applies to signals with type
   * SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY.
   */
  automatedBackupPolicyInfo?: AutomatedBackupPolicyInfo;
  /**
   * Backup run information applies to signals with types
   * SIGNAL_TYPE_LAST_BACKUP_FAILED and SIGNAL_TYPE_LAST_BACKUP_OLD.
   */
  backupRunInfo?: BackupRunInfo;
  /**
   * Deletion protection information applies to signals with type
   * SIGNAL_TYPE_NO_DELETION_PROTECTION
   */
  deletionProtectionInfo?: DeletionProtectionInfo;
  /**
   * Inefficient query information applies to signals with type
   * SIGNAL_TYPE_INEFFICIENT_QUERY.
   */
  inefficientQueryInfo?: InefficientQueryInfo;
  /**
   * Maintenance recommendation information applies to signals with type
   * SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES.
   */
  maintenanceRecommendationInfo?: MaintenanceRecommendationInfo;
  /**
   * Outdated minor version information applies to signals with type
   * SIGNAL_TYPE_OUTDATED_MINOR_VERSION.
   */
  outdatedMinorVersionInfo?: OutdatedMinorVersionInfo;
  /**
   * Recommendation information applies to recommendations.
   */
  recommendationInfo?: RecommendationInfo;
  /**
   * Resource suspension information applies to signals with type
   * SIGNAL_TYPE_RESOURCE_SUSPENDED.
   */
  resourceSuspensionInfo?: ResourceSuspensionInfo;
  /**
   * SCC information applies to SCC signals.
   */
  sccInfo?: SCCInfo;
  /**
   * Short backup retention information applies to signals with type
   * SIGNAL_TYPE_SHORT_BACKUP_RETENTION.
   */
  shortBackupRetentionInfo?: RetentionSettingsInfo;
  /**
   * Event time when signal was recorded by source service.
   */
  signalEventTime?: Date;
  /**
   * Where the signal is coming from.
   */
  signalSource?:  | "SIGNAL_SOURCE_UNSPECIFIED" | "SIGNAL_SOURCE_RESOURCE_METADATA" | "SIGNAL_SOURCE_SECURITY_FINDINGS" | "SIGNAL_SOURCE_RECOMMENDER" | "SIGNAL_SOURCE_MODERN_OBSERVABILITY";
  /**
   * Type of the signal.
   */
  signalType?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE";
}

function serializeAdditionalDetail(data: any): AdditionalDetail {
  return {
    ...data,
    backupRunInfo: data["backupRunInfo"] !== undefined ? serializeBackupRunInfo(data["backupRunInfo"]) : undefined,
    inefficientQueryInfo: data["inefficientQueryInfo"] !== undefined ? serializeInefficientQueryInfo(data["inefficientQueryInfo"]) : undefined,
    shortBackupRetentionInfo: data["shortBackupRetentionInfo"] !== undefined ? serializeRetentionSettingsInfo(data["shortBackupRetentionInfo"]) : undefined,
    signalEventTime: data["signalEventTime"] !== undefined ? data["signalEventTime"].toISOString() : undefined,
  };
}

function deserializeAdditionalDetail(data: any): AdditionalDetail {
  return {
    ...data,
    backupRunInfo: data["backupRunInfo"] !== undefined ? deserializeBackupRunInfo(data["backupRunInfo"]) : undefined,
    inefficientQueryInfo: data["inefficientQueryInfo"] !== undefined ? deserializeInefficientQueryInfo(data["inefficientQueryInfo"]) : undefined,
    shortBackupRetentionInfo: data["shortBackupRetentionInfo"] !== undefined ? deserializeRetentionSettingsInfo(data["shortBackupRetentionInfo"]) : undefined,
    signalEventTime: data["signalEventTime"] !== undefined ? new Date(data["signalEventTime"]) : undefined,
  };
}

/**
 * Affiliation information of a resource
 */
export interface Affiliation {
  /**
   * Optional. Full resource name
   */
  fullResourceName?: string;
  /**
   * Optional. Multiple lineages can be created from a resource. For example, a
   * resource can be replicated to multiple target resources. In this case,
   * there will be multiple lineages for the resource, one for each target
   * resource.
   */
  lineages?: Lineage[];
  /**
   * Optional. resource id of affiliated resource
   */
  resourceId?: string;
}

/**
 * The response message to aggregate a fleet by some group by fields.
 */
export interface AggregateFleetResponse {
  /**
   * A token that can be sent as `page_token` to retrieve the next page. If
   * this field is omitted, there are no subsequent pages.
   */
  nextPageToken?: string;
  /**
   * Count of all resource groups in the fleet. This includes counts from all
   * pages.
   */
  resourceGroupsTotalCount?: number;
  /**
   * Count of all resources in the fleet. This includes counts from all pages.
   */
  resourceTotalCount?: number;
  /**
   * Represents a row grouped by the fields in the input.
   */
  rows?: AggregateFleetRow[];
  /**
   * Output only. The total number of rows in the entire list.
   */
  readonly totalSize?: bigint;
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

/**
 * Individual row grouped by a particular dimension.
 */
export interface AggregateFleetRow {
  /**
   * Optional. Delta counts and details of resources which were added
   * to/deleted from fleet.
   */
  deltaDetails?: DeltaDetails;
  /**
   * Group by dimension.
   */
  dimension?: Dimension[];
  /**
   * Number of resource groups that have a particular dimension.
   */
  resourceGroupsCount?: number;
  /**
   * Number of resources that have a particular dimension.
   */
  resourcesCount?: number;
}

/**
 * AggregateIssueStatsRequest represents the input to the AggregateIssueStats
 * method.
 */
export interface AggregateIssueStatsRequest {
  /**
   * Optional. The baseline date w.r.t. which the delta counts are calculated.
   * If not set, delta counts are not included in the response and the response
   * indicates the current state of the fleet.
   */
  baselineDate?: Date;
  /**
   * Optional. The expression to filter resources. Supported fields are:
   * `full_resource_name`, `resource_type`, `container`, `product.type`,
   * `product.engine`, `product.version`, `location`, `labels`, `issues`, fields
   * of availability_info, data_protection_info,'resource_name', etc. The
   * expression is a list of zero or more restrictions combined via logical
   * operators `AND` and `OR`. When `AND` and `OR` are both used in the
   * expression, parentheses must be appropriately used to group the
   * combinations. Example: `location="us-east1"` Example:
   * `container="projects/123" OR container="projects/456"` Example:
   * `(container="projects/123" OR container="projects/456") AND
   * location="us-east1"`
   */
  filter?: string;
  /**
   * Required. Parent can be a project, a folder, or an organization. The
   * search is limited to the resources within the `scope`. The allowed values
   * are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") *
   * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") *
   * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") *
   * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  parent?: string;
  /**
   * Optional. Lists of signal types that are issues.
   */
  signalTypeGroups?: SignalTypeGroup[];
}

/**
 * The response message containing one of more group of relevant health issues
 * for database resources.
 */
export interface AggregateIssueStatsResponse {
  /**
   * List of issue group stats where each group contains stats for resources
   * having a particular combination of relevant issues.
   */
  issueGroupStats?: IssueGroupStats[];
  /**
   * Total count of the resource filtered in based on the user given filter.
   */
  totalResourceGroupsCount?: number;
  /**
   * Total count of the resources filtered in based on the user given filter.
   */
  totalResourcesCount?: number;
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

/**
 * AggregateQueryStatsRequest represents the input to the AggregateQueryStats
 * method.
 */
export interface AggregateQueryStatsRequest {
  /**
   * Optional. The expression to filter resources. Supported fields are:
   * `full_resource_name`, `resource_type`, `container`, `product.type`,
   * `product.engine`, `product.version`, `location`, `labels`, `issues`, fields
   * of availability_info, data_protection_info,'resource_name', etc. The
   * expression is a list of zero or more restrictions combined via logical
   * operators `AND` and `OR`. When `AND` and `OR` are both used in the
   * expression, parentheses must be appropriately used to group the
   * combinations. Example: `location="us-east1"` Example:
   * `container="projects/123" OR container="projects/456"` Example:
   * `(container="projects/123" OR container="projects/456") AND
   * location="us-east1"` Additional specific fields for query stats are:
   * `metric_window`, `query_hash`, `normalized_query`. Example:
   * `metric_window="LAST_ONE_DAY"` (Possible values for `metric_window` are:
   * `LAST_ONE_DAY`, `LAST_ONE_WEEK`, `LAST_TWO_WEEKS`) Example:
   * `query_hash="12345678"` Example: `normalized_query="SELECT * FROM table"`
   */
  filter?: string;
  /**
   * Optional. The expression to order the results by. Example:
   * `order_by="execution_count"` Example: `order_by="execution_count desc"`
   * Supported order by fields are `execution_count`, `rows_processed`,
   * `total_cpu_time`, `avg_cpu_time`.
   */
  orderBy?: string;
  /**
   * Optional. If unspecified, at most 100 query stats will be returned. The
   * maximum value is 1000; values above 1000 will be coerced to 1000.
   */
  pageSize?: number;
  /**
   * Optional. A page token, received from a previous
   * `AggregateQueryStatsRequest` call. Provide this to retrieve the subsequent
   * page. All parameters except page_token should match the parameters in the
   * call that provided the page token.
   */
  pageToken?: string;
}

/**
 * The response message containing relevant query stats for database resources.
 */
export interface AggregateQueryStatsResponse {
  /**
   * A token that can be sent as `page_token` to retrieve the next page. If
   * this field is omitted, there are no subsequent pages.
   */
  nextPageToken?: string;
  /**
   * List of query stats where each group contains stats for resources having a
   * particular combination of relevant query stats.
   */
  queryStats?: QueryStatsInfo[];
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

function serializeAggregateQueryStatsResponse(data: any): AggregateQueryStatsResponse {
  return {
    ...data,
    queryStats: data["queryStats"] !== undefined ? data["queryStats"].map((item: any) => (serializeQueryStatsInfo(item))) : undefined,
  };
}

function deserializeAggregateQueryStatsResponse(data: any): AggregateQueryStatsResponse {
  return {
    ...data,
    queryStats: data["queryStats"] !== undefined ? data["queryStats"].map((item: any) => (deserializeQueryStatsInfo(item))) : undefined,
  };
}

/**
 * Automated backup policy signal info
 */
export interface AutomatedBackupPolicyInfo {
  /**
   * Is automated policy enabled.
   */
  isEnabled?: boolean;
  /**
   * Optional. Sub resource details associated with the signal.
   */
  subResource?: SubResource;
}

/**
 * BackupDRConfig to capture the backup and disaster recovery details of
 * database resource.
 */
export interface BackupDRConfig {
  /**
   * Indicates if the resource is managed by BackupDR.
   */
  backupdrManaged?: boolean;
}

/**
 * Metadata about latest backup run state for a database resource.
 */
export interface BackupRunInfo {
  /**
   * The time the backup operation completed.
   */
  endTime?: Date;
  /**
   * Additional information about the error encountered.
   */
  errorMessage?: string;
  /**
   * Optional. OperationErrorType to expose specific error when backup
   * operation of database resource failed, that is state is FAILED.
   */
  operationErrorType?:  | "OPERATION_ERROR_TYPE_UNSPECIFIED" | "KMS_KEY_ERROR" | "DATABASE_ERROR" | "STOCKOUT_ERROR" | "CANCELLATION_ERROR" | "SQLSERVER_ERROR" | "INTERNAL_ERROR";
  /**
   * The time the backup operation started.
   */
  startTime?: Date;
  /**
   * Output only. The state of this run.
   */
  readonly state?:  | "STATE_UNSPECIFIED" | "SUCCEEDED" | "FAILED";
  /**
   * Optional. Sub resource details associated with the backup run.
   */
  subResource?: SubResource;
}

function serializeBackupRunInfo(data: any): BackupRunInfo {
  return {
    ...data,
    endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined,
    startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined,
  };
}

function deserializeBackupRunInfo(data: any): BackupRunInfo {
  return {
    ...data,
    endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined,
    startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined,
  };
}

/**
 * DatabaseResource represents every individually configured database unit
 * representing compute and/or storage.
 */
export interface DatabaseResource {
  /**
   * Optional. Affiliation details of the resource.
   */
  affiliations?: Affiliation[];
  /**
   * Optional. Backup and disaster recovery details for the resource.
   */
  backupdrConfig?: BackupDRConfig;
  /**
   * List of children associated with a database group.
   */
  childResources?: DatabaseResource[];
  /**
   * Specifies where the resource is created. For Google Cloud resources, it is
   * the full name of the project.
   */
  container?: string;
  /**
   * The edition of the resource.
   */
  edition?:  | "EDITION_UNSPECIFIED" | "EDITION_ENTERPRISE" | "EDITION_ENTERPRISE_PLUS" | "EDITION_STANDARD";
  /**
   * The full resource name, based on CAIS resource name format
   * https://cloud.google.com/asset-inventory/docs/resource-name-format Example:
   * `//cloudsql.googleapis.com/projects/project-number/instances/mysql-1`
   * `//cloudsql.googleapis.com/projects/project-number/instances/postgres-1`
   * `//spanner.googleapis.com/projects/project-number/instances/spanner-instance-1`
   * `//alloydb.googleapis.com/projects/project-number/locations/us-central1/clusters/c1`
   * `//alloydb.googleapis.com/projects/project-number/locations/us-central1/clusters/c1/instances/i1`
   */
  fullResourceName?: string;
  /**
   * Labels applied on the resource. The requirements for labels assigned to
   * Google Cloud resources may be found at
   * https://cloud.google.com/resource-manager/docs/labels-overview#requirements
   */
  labels?: Label[];
  /**
   * The location of the resources. It supports returning only regional
   * locations in Google Cloud. These are of the form: "us-central1",
   * "us-east1", etc. See https://cloud.google.com/about/locations for a list of
   * such regions.
   */
  location?: string;
  /**
   * Machine configuration like CPU, memory, etc for the resource.
   */
  machineConfig?: MachineConfig;
  /**
   * Optional. The maintenance information of the resource.
   */
  maintenanceInfo?: MaintenanceInfo;
  /**
   * Observable metrics for the resource e.g. CPU utilization, memory
   * utilization, etc.
   */
  metrics?: Metrics;
  /**
   * The product this resource represents.
   */
  product?: Product;
  /**
   * The category of the resource.
   */
  resourceCategory?:  | "RESOURCE_CATEGORY_UNSPECIFIED" | "INSTANCE" | "CLUSTER" | "DATABASE" | "DATASET" | "RESERVATION";
  /**
   * The name of the resource(The last part of the full resource name).
   * Example: For full resource name -
   * `//cloudsql.googleapis.com/projects/project-number/instances/mysql-1`,
   * resource name - `mysql-1` For full resource name -
   * `//cloudsql.googleapis.com/projects/project-number/instances/postgres-1` ,
   * resource name - `postgres-1` Note: In some cases, there might be more than
   * one resource with the same resource name.
   */
  resourceName?: string;
  /**
   * The type of resource defined according to the pattern: {Service
   * Name}/{Type}. Ex: sqladmin.googleapis.com/Instance
   * alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
   * spanner.googleapis.com/Instance
   */
  resourceType?: string;
  /**
   * The list of signal groups and count of issues related to the resource.
   * Only those signals which have been requested would be included.
   */
  signalGroups?: SignalGroup[];
  /**
   * Subtype of the resource specified at creation time.
   */
  subResourceType?:  | "SUB_RESOURCE_TYPE_UNSPECIFIED" | "SUB_RESOURCE_TYPE_PRIMARY" | "SUB_RESOURCE_TYPE_SECONDARY" | "SUB_RESOURCE_TYPE_READ_REPLICA" | "SUB_RESOURCE_TYPE_EXTERNAL_PRIMARY" | "SUB_RESOURCE_TYPE_READ_POOL" | "SUB_RESOURCE_TYPE_RESERVATION" | "SUB_RESOURCE_TYPE_DATASET" | "SUB_RESOURCE_TYPE_OTHER";
  /**
   * Tags applied on the resource. The requirements for tags assigned to Google
   * Cloud resources may be found at
   * https://cloud.google.com/resource-manager/docs/tags/tags-overview
   */
  tags?: Tag[];
}

function serializeDatabaseResource(data: any): DatabaseResource {
  return {
    ...data,
    childResources: data["childResources"] !== undefined ? data["childResources"].map((item: any) => (serializeDatabaseResource(item))) : undefined,
    machineConfig: data["machineConfig"] !== undefined ? serializeMachineConfig(data["machineConfig"]) : undefined,
    metrics: data["metrics"] !== undefined ? serializeMetrics(data["metrics"]) : undefined,
    signalGroups: data["signalGroups"] !== undefined ? data["signalGroups"].map((item: any) => (serializeSignalGroup(item))) : undefined,
  };
}

function deserializeDatabaseResource(data: any): DatabaseResource {
  return {
    ...data,
    childResources: data["childResources"] !== undefined ? data["childResources"].map((item: any) => (deserializeDatabaseResource(item))) : undefined,
    machineConfig: data["machineConfig"] !== undefined ? deserializeMachineConfig(data["machineConfig"]) : undefined,
    metrics: data["metrics"] !== undefined ? deserializeMetrics(data["metrics"]) : undefined,
    signalGroups: data["signalGroups"] !== undefined ? data["signalGroups"].map((item: any) => (deserializeSignalGroup(item))) : undefined,
  };
}

/**
 * DatabaseResourceGroup represents all resources that serve a common data set.
 * It is considered notionally as a single entity, powered by any number of
 * units of compute and storage.
 */
export interface DatabaseResourceGroup {
  /**
   * A database resource that serves as a root of the group of database
   * resources. It is repeated just in case we have the concept of multiple
   * roots in the future, however, it will only be populated with a single value
   * for now.
   */
  rootResources?: DatabaseResource[];
  /**
   * The filtered signal groups and the count of issues associated with the
   * resources that have been filtered in.
   */
  signalGroups?: IssueCount[];
}

function serializeDatabaseResourceGroup(data: any): DatabaseResourceGroup {
  return {
    ...data,
    rootResources: data["rootResources"] !== undefined ? data["rootResources"].map((item: any) => (serializeDatabaseResource(item))) : undefined,
  };
}

function deserializeDatabaseResourceGroup(data: any): DatabaseResourceGroup {
  return {
    ...data,
    rootResources: data["rootResources"] !== undefined ? data["rootResources"].map((item: any) => (deserializeDatabaseResource(item))) : undefined,
  };
}

/**
 * DatabaseResource and Issue associated with it.
 */
export interface DatabaseResourceIssue {
  /**
   * Resource associated with the issue.
   */
  resource?: DatabaseResource;
  /**
   * Signal associated with the issue.
   */
  signal?: Signal;
}

function serializeDatabaseResourceIssue(data: any): DatabaseResourceIssue {
  return {
    ...data,
    resource: data["resource"] !== undefined ? serializeDatabaseResource(data["resource"]) : undefined,
    signal: data["signal"] !== undefined ? serializeSignal(data["signal"]) : undefined,
  };
}

function deserializeDatabaseResourceIssue(data: any): DatabaseResourceIssue {
  return {
    ...data,
    resource: data["resource"] !== undefined ? deserializeDatabaseResource(data["resource"]) : undefined,
    signal: data["signal"] !== undefined ? deserializeSignal(data["signal"]) : undefined,
  };
}

/**
 * Represents a whole or partial calendar date, such as a birthday. The time of
 * day and time zone are either specified elsewhere or are insignificant. The
 * date is relative to the Gregorian Calendar. This can represent one of the
 * following: * A full date, with non-zero year, month, and day values. * A
 * month and day, with a zero year (for example, an anniversary). * A year on
 * its own, with a zero month and a zero day. * A year and month, with a zero
 * day (for example, a credit card expiration date). Related types: *
 * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
 */
export interface Date {
  /**
   * Day of a month. Must be from 1 to 31 and valid for the year and month, or
   * 0 to specify a year by itself or a year and month where the day isn't
   * significant.
   */
  day?: number;
  /**
   * Month of a year. Must be from 1 to 12, or 0 to specify a year without a
   * month and day.
   */
  month?: number;
  /**
   * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a
   * year.
   */
  year?: number;
}

/**
 * Deletion protection signal info for a database resource.
 */
export interface DeletionProtectionInfo {
  /**
   * Is deletion protection enabled.
   */
  deletionProtectionEnabled?: boolean;
  /**
   * Optional. Sub resource details associated with the signal.
   */
  subResource?: SubResource;
}

/**
 * Captures the details of items that have increased or decreased in some
 * bucket when compared to some point in history. It is currently used to
 * capture the delta of resources that have been added or removed in the fleet
 * as well as to capture the resources that have a change in Issue/Signal
 * status.
 */
export interface DeltaDetails {
  /**
   * Details of resources that have decreased.
   */
  decreasedResources?: ResourceDetails[];
  /**
   * Details of resources that have increased.
   */
  increasedResources?: ResourceDetails[];
}

/**
 * Dimension used to aggregate the fleet.
 */
export interface Dimension {
  /**
   * Specifies where the resource is created. For Google Cloud resources, it is
   * the full name of the project.
   */
  container?: string;
  /**
   * The edition of the resource.
   */
  edition?:  | "EDITION_UNSPECIFIED" | "EDITION_ENTERPRISE" | "EDITION_ENTERPRISE_PLUS" | "EDITION_STANDARD";
  /**
   * Whether the resource has deny maintenance schedules.
   */
  hasDenyMaintenanceSchedules?: boolean;
  /**
   * Whether the resource has a maintenance schedule.
   */
  hasMaintenanceSchedule?: boolean;
  /**
   * Label key of the resource.
   */
  labelKey?: string;
  /**
   * Label source of the resource.
   */
  labelSource?: string;
  /**
   * Label value of the resource.
   */
  labelValue?: string;
  /**
   * The location of the resources. It supports returning only regional
   * locations in Google Cloud.
   */
  location?: string;
  /**
   * The management type of the resource.
   */
  managementType?:  | "MANAGEMENT_TYPE_UNSPECIFIED" | "MANAGEMENT_TYPE_GCP_MANAGED" | "MANAGEMENT_TYPE_SELF_MANAGED";
  /**
   * Engine refers to underlying database binary running in an instance.
   */
  productEngine?:  | "ENGINE_UNSPECIFIED" | "ENGINE_MYSQL" | "ENGINE_POSTGRES" | "ENGINE_SQL_SERVER" | "ENGINE_NATIVE" | "ENGINE_MEMORYSTORE_FOR_REDIS" | "ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER" | "ENGINE_MEMORSTORE_FOR_VALKEY" | "ENGINE_FIRESTORE_WITH_NATIVE_MODE" | "ENGINE_FIRESTORE_WITH_DATASTORE_MODE" | "ENGINE_EXADATA_ORACLE" | "ENGINE_ADB_SERVERLESS_ORACLE" | "ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE" | "ENGINE_OTHER";
  /**
   * Type to identify a product
   */
  productType?:  | "PRODUCT_TYPE_UNSPECIFIED" | "PRODUCT_TYPE_CLOUD_SQL" | "PRODUCT_TYPE_ALLOYDB" | "PRODUCT_TYPE_SPANNER" | "PRODUCT_TYPE_BIGTABLE" | "PRODUCT_TYPE_MEMORYSTORE" | "PRODUCT_TYPE_FIRESTORE" | "PRODUCT_TYPE_COMPUTE_ENGINE" | "PRODUCT_TYPE_ORACLE_ON_GCP" | "PRODUCT_TYPE_BIGQUERY" | "PRODUCT_TYPE_OTHER";
  /**
   * Version of the underlying database engine
   */
  productVersion?: string;
  /**
   * The category of the resource.
   */
  resourceCategory?:  | "RESOURCE_CATEGORY_UNSPECIFIED" | "INSTANCE" | "CLUSTER" | "DATABASE" | "DATASET" | "RESERVATION";
  /**
   * The type of resource defined according to the pattern: {Service
   * Name}/{Type}. Ex: sqladmin.googleapis.com/Instance
   * alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
   * spanner.googleapis.com/Instance
   */
  resourceType?: string;
  /**
   * Subtype of the resource specified at creation time.
   */
  subResourceType?:  | "SUB_RESOURCE_TYPE_UNSPECIFIED" | "SUB_RESOURCE_TYPE_PRIMARY" | "SUB_RESOURCE_TYPE_SECONDARY" | "SUB_RESOURCE_TYPE_READ_REPLICA" | "SUB_RESOURCE_TYPE_EXTERNAL_PRIMARY" | "SUB_RESOURCE_TYPE_READ_POOL" | "SUB_RESOURCE_TYPE_RESERVATION" | "SUB_RESOURCE_TYPE_DATASET" | "SUB_RESOURCE_TYPE_OTHER";
  /**
   * Tag inheritance value of the resource.
   */
  tagInherited?: boolean;
  /**
   * Tag key of the resource.
   */
  tagKey?: string;
  /**
   * Tag source of the resource.
   */
  tagSource?: string;
  /**
   * Tag value of the resource.
   */
  tagValue?: string;
}

/**
 * Metadata about inefficient query signal info for a database resource.
 */
export interface InefficientQueryInfo {
  /**
   * Name of the database where index is required. For example, "db1", which is
   * the name of the database present in the instance.
   */
  database?: string;
  /**
   * Count of queries to be impacted if index is applied
   */
  impactedQueriesCount?: bigint;
  /**
   * SQL statement of the index. Based on the ddl type, this will be either
   * CREATE INDEX or DROP INDEX.
   */
  sqlIndexStatement?: string;
  /**
   * Cost of additional disk usage in bytes
   */
  storageCostBytes?: bigint;
  /**
   * Name of the table where index is required
   */
  table?: string;
}

function serializeInefficientQueryInfo(data: any): InefficientQueryInfo {
  return {
    ...data,
    impactedQueriesCount: data["impactedQueriesCount"] !== undefined ? String(data["impactedQueriesCount"]) : undefined,
    storageCostBytes: data["storageCostBytes"] !== undefined ? String(data["storageCostBytes"]) : undefined,
  };
}

function deserializeInefficientQueryInfo(data: any): InefficientQueryInfo {
  return {
    ...data,
    impactedQueriesCount: data["impactedQueriesCount"] !== undefined ? BigInt(data["impactedQueriesCount"]) : undefined,
    storageCostBytes: data["storageCostBytes"] !== undefined ? BigInt(data["storageCostBytes"]) : undefined,
  };
}

/**
 * Count of issues for a group of signals.
 */
export interface IssueCount {
  /**
   * Title of a signal group corresponding to the request.
   */
  displayName?: string;
  /**
   * The count of the number of issues associated with those resources that are
   * explicitly filtered in by the filters present in the request. A signal is
   * an issue when its SignalStatus field is set to SIGNAL_STATUS_ISSUE.
   */
  issueCount?: number;
}

/**
 * IssueGroupStats refers to stats for a particulare combination of relevant
 * health issues of database resources.
 */
export interface IssueGroupStats {
  /**
   * Database resource level health card name. This will corresponds to one of
   * the requested input group names.
   */
  displayName?: string;
  /**
   * The number of resource groups from the total groups as defined above that
   * are healthy with respect to all of the specified issues.
   */
  healthyResourceGroupsCount?: number;
  /**
   * The number of resources from the total defined above in field
   * total_resources_count that are healthy with respect to all of the specified
   * issues.
   */
  healthyResourcesCount?: number;
  /**
   * List of issues stats containing count of resources having particular issue
   * category.
   */
  issueStats?: IssueStats[];
  /**
   * Total count of the groups of resources returned by the filter that also
   * have one or more resources for which any of the specified issues are
   * applicable.
   */
  resourceGroupsCount?: number;
  /**
   * Total count of resources returned by the filter for which any of the
   * specified issues are applicable.
   */
  resourcesCount?: number;
}

/**
 * IssueStats holds stats for a particular signal category.
 */
export interface IssueStats {
  /**
   * Optional. Delta counts and details of resources for which issue was raised
   * or fixed.
   */
  deltaDetails?: DeltaDetails;
  /**
   * Severity of the issue.
   */
  issueSeverity?:  | "ISSUE_SEVERITY_UNSPECIFIED" | "ISSUE_SEVERITY_LOW" | "ISSUE_SEVERITY_MEDIUM" | "ISSUE_SEVERITY_HIGH" | "ISSUE_SEVERITY_CRITICAL" | "ISSUE_SEVERITY_IRRELEVANT";
  /**
   * Number of resources having issues of a given type.
   */
  resourceCount?: number;
  /**
   * Type of signal which is an issue.
   */
  signalType?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE";
}

/**
 * Label is a key value pair applied to a resource.
 */
export interface Label {
  /**
   * The key part of the label.
   */
  key?: string;
  /**
   * The source of the Label. Source is empty if the label is directly attached
   * to the resource and not inherited.
   */
  source?: string;
  /**
   * The value part of the label.
   */
  value?: string;
}

/**
 * lineage information of the affiliated resources This captures source, target
 * and process which created the lineage.
 */
export interface Lineage {
  /**
   * Optional. FQN of process which created the lineage i.e. dataplex,
   * datastream etc.
   */
  processFqn?: string;
  /**
   * Optional. Type of process which created the lineage.
   */
  processType?:  | "PROCESS_TYPE_UNSPECIFIED" | "COMPOSER" | "DATASTREAM" | "DATAFLOW" | "BIGQUERY" | "DATA_FUSION" | "DATAPROC";
  /**
   * Optional. FQN of source table / column
   */
  sourceFqn?: string;
  /**
   * Optional. FQN of target table / column
   */
  targetFqn?: string;
}

/**
 * MachineConfig describes the configuration of a machine specific to a
 * Database Resource.
 */
export interface MachineConfig {
  /**
   * Optional. Baseline slots for BigQuery Reservations. Baseline slots are in
   * increments of 50.
   */
  baselineSlotCount?: bigint;
  /**
   * Optional. Max slots for BigQuery Reservations. Max slots are in increments
   * of 50.
   */
  maxReservationSlotCount?: bigint;
  /**
   * Memory size in bytes.
   */
  memorySizeBytes?: bigint;
  /**
   * Optional. The number of Shards (if applicable).
   */
  shardCount?: number;
  /**
   * Optional. The number of vCPUs (if applicable).
   */
  vcpuCount?: number;
}

function serializeMachineConfig(data: any): MachineConfig {
  return {
    ...data,
    baselineSlotCount: data["baselineSlotCount"] !== undefined ? String(data["baselineSlotCount"]) : undefined,
    maxReservationSlotCount: data["maxReservationSlotCount"] !== undefined ? String(data["maxReservationSlotCount"]) : undefined,
    memorySizeBytes: data["memorySizeBytes"] !== undefined ? String(data["memorySizeBytes"]) : undefined,
  };
}

function deserializeMachineConfig(data: any): MachineConfig {
  return {
    ...data,
    baselineSlotCount: data["baselineSlotCount"] !== undefined ? BigInt(data["baselineSlotCount"]) : undefined,
    maxReservationSlotCount: data["maxReservationSlotCount"] !== undefined ? BigInt(data["maxReservationSlotCount"]) : undefined,
    memorySizeBytes: data["memorySizeBytes"] !== undefined ? BigInt(data["memorySizeBytes"]) : undefined,
  };
}

/**
 * MaintenanceInfo to capture the maintenance details of database resource.
 */
export interface MaintenanceInfo {
  /**
   * Output only. The date when the maintenance version was released.
   */
  readonly currentVersionReleaseDate?: Date;
  /**
   * Optional. List of Deny maintenance period for the database resource.
   */
  denyMaintenanceSchedules?: ResourceMaintenanceDenySchedule[];
  /**
   * Optional. Maintenance window for the database resource.
   */
  maintenanceSchedule?: ResourceMaintenanceSchedule;
  /**
   * Output only. Current Maintenance version of the database resource.
   * Example: "MYSQL_8_0_41.R20250531.01_15"
   */
  readonly maintenanceVersion?: string;
  /**
   * Output only. List of possible reasons why the maintenance is not
   * completed. This is an optional field and is only populated if there are any
   * reasons for failures recorded for the maintenance by DB Center. FAILURE
   * maintenance status may not always have a failure reason.
   */
  readonly possibleFailureReasons?:  | "POSSIBLE_FAILURE_REASON_UNSPECIFIED" | "POSSIBLE_FAILURE_REASON_DENY_POLICY_CONFLICT" | "POSSIBLE_FAILURE_REASON_INSTANCE_IN_STOPPED_STATE"[];
  /**
   * Output only. Previous maintenance version of the database resource.
   * Example: "MYSQL_8_0_41.R20250531.01_15". This is available once a minor
   * version maintenance is complete on a database resource.
   */
  readonly previousMaintenanceVersion?: string;
  /**
   * Output only. Resource maintenance state. This is to capture the current
   * state of the maintenance.
   */
  readonly state?:  | "MAINTENANCE_STATE_UNSPECIFIED" | "MAINTENANCE_STATE_SCHEDULED" | "MAINTENANCE_STATE_IN_PROGRESS" | "MAINTENANCE_STATE_COMPLETED" | "MAINTENANCE_STATE_FAILED";
  /**
   * Output only. Upcoming maintenance window for the database resource. This
   * is only populated for an engine, if upcoming maintenance is scheduled for
   * the resource. This schedule is generated per engine and engine version, and
   * there is only one upcoming maintenance window at any given time. In case of
   * upcoming maintenance, the maintenance_state will be set to SCHEDULED first,
   * and then IN_PROGRESS when the maintenance window starts.
   */
  readonly upcomingMaintenance?: UpcomingMaintenance;
}

/**
 * Info associated with maintenance recommendation.
 */
export interface MaintenanceRecommendationInfo {
  /**
   * Optional. List of recommended maintenance schedules for the database
   * resource.
   */
  resourceMaintenanceSchedules?: ResourceMaintenanceSchedule[];
}

/**
 * MetricData represents the metric data for a database resource.
 */
export interface MetricData {
  /**
   * The time the metric was observed in the metric source service.
   */
  observationTime?: Date;
  /**
   * The value associated with the metric.
   */
  value?: TypedValue;
}

function serializeMetricData(data: any): MetricData {
  return {
    ...data,
    observationTime: data["observationTime"] !== undefined ? data["observationTime"].toISOString() : undefined,
    value: data["value"] !== undefined ? serializeTypedValue(data["value"]) : undefined,
  };
}

function deserializeMetricData(data: any): MetricData {
  return {
    ...data,
    observationTime: data["observationTime"] !== undefined ? new Date(data["observationTime"]) : undefined,
    value: data["value"] !== undefined ? deserializeTypedValue(data["value"]) : undefined,
  };
}

/**
 * Metrics represents the metrics for a database resource.
 */
export interface Metrics {
  /**
   * Current memory used by the resource in bytes.
   */
  currentMemoryUsedBytes?: MetricData;
  /**
   * Current storage used by the resource in bytes.
   */
  currentStorageUsedBytes?: MetricData;
  /**
   * Number of nodes in instance for spanner or bigtable.
   */
  nodeCount?: MetricData;
  /**
   * P95 CPU utilization observed for the resource. The value is a fraction
   * between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
   */
  p95CpuUtilization?: MetricData;
  /**
   * P99 CPU utilization observed for the resource. The value is a fraction
   * between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
   */
  p99CpuUtilization?: MetricData;
  /**
   * Peak memory utilization observed for the resource. The value is a fraction
   * between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
   */
  peakMemoryUtilization?: MetricData;
  /**
   * Peak number of connections observed for the resource. The value is a
   * positive integer.
   */
  peakNumberConnections?: MetricData;
  /**
   * Peak storage utilization observed for the resource. The value is a
   * fraction between 0.0 and 1.0 (may momentarily exceed 1.0 in some cases).
   */
  peakStorageUtilization?: MetricData;
  /**
   * Number of processing units in spanner.
   */
  processingUnitCount?: MetricData;
}

function serializeMetrics(data: any): Metrics {
  return {
    ...data,
    currentMemoryUsedBytes: data["currentMemoryUsedBytes"] !== undefined ? serializeMetricData(data["currentMemoryUsedBytes"]) : undefined,
    currentStorageUsedBytes: data["currentStorageUsedBytes"] !== undefined ? serializeMetricData(data["currentStorageUsedBytes"]) : undefined,
    nodeCount: data["nodeCount"] !== undefined ? serializeMetricData(data["nodeCount"]) : undefined,
    p95CpuUtilization: data["p95CpuUtilization"] !== undefined ? serializeMetricData(data["p95CpuUtilization"]) : undefined,
    p99CpuUtilization: data["p99CpuUtilization"] !== undefined ? serializeMetricData(data["p99CpuUtilization"]) : undefined,
    peakMemoryUtilization: data["peakMemoryUtilization"] !== undefined ? serializeMetricData(data["peakMemoryUtilization"]) : undefined,
    peakNumberConnections: data["peakNumberConnections"] !== undefined ? serializeMetricData(data["peakNumberConnections"]) : undefined,
    peakStorageUtilization: data["peakStorageUtilization"] !== undefined ? serializeMetricData(data["peakStorageUtilization"]) : undefined,
    processingUnitCount: data["processingUnitCount"] !== undefined ? serializeMetricData(data["processingUnitCount"]) : undefined,
  };
}

function deserializeMetrics(data: any): Metrics {
  return {
    ...data,
    currentMemoryUsedBytes: data["currentMemoryUsedBytes"] !== undefined ? deserializeMetricData(data["currentMemoryUsedBytes"]) : undefined,
    currentStorageUsedBytes: data["currentStorageUsedBytes"] !== undefined ? deserializeMetricData(data["currentStorageUsedBytes"]) : undefined,
    nodeCount: data["nodeCount"] !== undefined ? deserializeMetricData(data["nodeCount"]) : undefined,
    p95CpuUtilization: data["p95CpuUtilization"] !== undefined ? deserializeMetricData(data["p95CpuUtilization"]) : undefined,
    p99CpuUtilization: data["p99CpuUtilization"] !== undefined ? deserializeMetricData(data["p99CpuUtilization"]) : undefined,
    peakMemoryUtilization: data["peakMemoryUtilization"] !== undefined ? deserializeMetricData(data["peakMemoryUtilization"]) : undefined,
    peakNumberConnections: data["peakNumberConnections"] !== undefined ? deserializeMetricData(data["peakNumberConnections"]) : undefined,
    peakStorageUtilization: data["peakStorageUtilization"] !== undefined ? deserializeMetricData(data["peakStorageUtilization"]) : undefined,
    processingUnitCount: data["processingUnitCount"] !== undefined ? deserializeMetricData(data["processingUnitCount"]) : undefined,
  };
}

/**
 * Info associated with outdated minor version.
 */
export interface OutdatedMinorVersionInfo {
  /**
   * Recommended minor version of the underlying database engine. Example
   * values: For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it
   * could be "14.4", "15.5" etc.
   */
  recommendedMinorVersion?: string;
}

/**
 * Product specification for databasecenter resources.
 */
export interface Product {
  /**
   * Optional. The specific engine that the underlying database is running.
   */
  engine?:  | "ENGINE_UNSPECIFIED" | "ENGINE_MYSQL" | "ENGINE_POSTGRES" | "ENGINE_SQL_SERVER" | "ENGINE_NATIVE" | "ENGINE_MEMORYSTORE_FOR_REDIS" | "ENGINE_MEMORYSTORE_FOR_REDIS_CLUSTER" | "ENGINE_MEMORSTORE_FOR_VALKEY" | "ENGINE_FIRESTORE_WITH_NATIVE_MODE" | "ENGINE_FIRESTORE_WITH_DATASTORE_MODE" | "ENGINE_EXADATA_ORACLE" | "ENGINE_ADB_SERVERLESS_ORACLE" | "ENGINE_FIRESTORE_WITH_MONGODB_COMPATIBILITY_MODE" | "ENGINE_OTHER";
  /**
   * Optional. Minor version of the underlying database engine. Example values:
   * For MySQL, it could be "8.0.35", "5.7.25" etc. For PostgreSQL, it could be
   * "14.4", "15.5" etc.
   */
  minorVersion?: string;
  /**
   * Optional. Type of specific database product. It could be CloudSQL, AlloyDB
   * etc..
   */
  type?:  | "PRODUCT_TYPE_UNSPECIFIED" | "PRODUCT_TYPE_CLOUD_SQL" | "PRODUCT_TYPE_ALLOYDB" | "PRODUCT_TYPE_SPANNER" | "PRODUCT_TYPE_BIGTABLE" | "PRODUCT_TYPE_MEMORYSTORE" | "PRODUCT_TYPE_FIRESTORE" | "PRODUCT_TYPE_COMPUTE_ENGINE" | "PRODUCT_TYPE_ORACLE_ON_GCP" | "PRODUCT_TYPE_BIGQUERY" | "PRODUCT_TYPE_OTHER";
  /**
   * Optional. Version of the underlying database engine. Example values: For
   * MySQL, it could be "8.0", "5.7" etc. For Postgres, it could be "14", "15"
   * etc.
   */
  version?: string;
}

/**
 * QueryDatabaseResourceGroupsRequest is the request to get a list of database
 * groups.
 */
export interface QueryDatabaseResourceGroupsRequest {
  /**
   * Optional. The expression to filter resources. The following fields are
   * filterable: * full_resource_name * resource_type * container * product.type
   * * product.engine * product.version * location * labels * resource_category
   * * machine_config.cpu_count * machine_config.memory_size_bytes *
   * machine_config.shard_count * resource_name * tags *
   * backupdr_config.backupdr_managed * edition The expression is a list of zero
   * or more restrictions combined via logical operators `AND` and `OR`. When
   * `AND` and `OR` are both used in the expression, parentheses must be
   * appropriately used to group the combinations. Example:
   * `location="us-east1"` Example: `container="projects/123" OR
   * container="projects/456"` Example: `(container="projects/123" OR
   * container="projects/456") AND location="us-east1"` Example:
   * `full_resource_name=~"test"` Example: `full_resource_name=~"test.*master"`
   */
  filter?: string;
  /**
   * Optional. A field that specifies the sort order of the results. The
   * following fields are sortable: * full_resource_name * product.type *
   * product.engine * product.version * container * issue_count *
   * machine_config.vcpu_count * machine_config.memory_size_bytes *
   * machine_config.shard_count * resource_name * issue_severity * signal_type *
   * location * resource_type * instance_type * edition *
   * metrics.p99_cpu_utilization * metrics.p95_cpu_utilization *
   * metrics.current_storage_used_bytes * metrics.node_count *
   * metrics.processing_unit_count * metrics.current_memory_used_bytes *
   * metrics.peak_storage_utilization * metrics.peak_number_connections *
   * metrics.peak_memory_utilization The default order is ascending. Add "DESC"
   * after the field name to indicate descending order. Add "ASC" after the
   * field name to indicate ascending order. It only supports a single field at
   * a time. For example: `order_by = "full_resource_name"` sorts response in
   * ascending order `order_by = "full_resource_name DESC"` sorts response in
   * descending order `order_by = "issue_count DESC"` sorts response in
   * descending order of count of all issues associated with a resource. More
   * explicitly, `order_by = "full_resource_name, product"` is not supported.
   */
  orderBy?: string;
  /**
   * Optional. If unspecified, at most 50 resource groups will be returned. The
   * maximum value is 1000; values above 1000 will be coerced to 1000.
   */
  pageSize?: number;
  /**
   * Optional. A page token, received from a previous
   * `QueryDatabaseResourceGroupsRequest` call. Provide this to retrieve the
   * subsequent page. All parameters except page_token should match the
   * parameters in the call that provided the page page token.
   */
  pageToken?: string;
  /**
   * Required. Parent can be a project, a folder, or an organization. The
   * search is limited to the resources within the `scope`. The allowed values
   * are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") *
   * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") *
   * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") *
   * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  parent?: string;
  /**
   * Optional. Filters based on signals. The list will be ORed together and
   * then ANDed with the `filters` field above.
   */
  signalFilters?: SignalFilter[];
  /**
   * Optional. Groups of signal types that are requested.
   */
  signalTypeGroups?: SignalTypeGroup[];
}

/**
 * QueryDatabaseResourceGroupsResponse represents the response message
 * containing a list of resource groups.
 */
export interface QueryDatabaseResourceGroupsResponse {
  /**
   * A token that can be sent as `page_token` to retrieve the next page. If
   * this field is omitted, there are no subsequent pages.
   */
  nextPageToken?: string;
  /**
   * List of database resource groups that pass the filter.
   */
  resourceGroups?: DatabaseResourceGroup[];
  /**
   * Output only. The total number of resource groups in the entire list.
   */
  readonly totalSize?: bigint;
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

function serializeQueryDatabaseResourceGroupsResponse(data: any): QueryDatabaseResourceGroupsResponse {
  return {
    ...data,
    resourceGroups: data["resourceGroups"] !== undefined ? data["resourceGroups"].map((item: any) => (serializeDatabaseResourceGroup(item))) : undefined,
  };
}

function deserializeQueryDatabaseResourceGroupsResponse(data: any): QueryDatabaseResourceGroupsResponse {
  return {
    ...data,
    resourceGroups: data["resourceGroups"] !== undefined ? data["resourceGroups"].map((item: any) => (deserializeDatabaseResourceGroup(item))) : undefined,
    totalSize: data["totalSize"] !== undefined ? BigInt(data["totalSize"]) : undefined,
  };
}

/**
 * QueryIssuesRequest is the request to get a list of issues.
 */
export interface QueryIssuesRequest {
  /**
   * Optional. Supported fields are: 'product', `location`, `issue_severity`,
   * 'tags', 'labels',
   */
  filter?: string;
  /**
   * Optional. Following fields are sortable: SignalType Product Location
   * IssueSeverity The default order is ascending. Add "DESC" after the field
   * name to indicate descending order. Add "ASC" after the field name to
   * indicate ascending order. It only supports a single field at a time.
   */
  orderBy?: string;
  /**
   * Optional. If unspecified, at most 50 issues will be returned. The maximum
   * value is 1000; values above 1000 will be coerced to 1000.
   */
  pageSize?: number;
  /**
   * Optional. A page token, received from a previous `QueryIssues` call.
   * Provide this to retrieve the subsequent page. All parameters except page
   * size should match the parameters used in the call that provided the page
   * token.
   */
  pageToken?: string;
  /**
   * Required. Parent can be a project, a folder, or an organization. The list
   * is limited to the one attached to resources within the `scope` that a user
   * has access to. The allowed values are: * projects/{PROJECT_ID} (e.g.,
   * "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g., "projects/12345678")
   * * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") *
   * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  parent?: string;
  /**
   * Optional. Filters based on signal and product. The filter list will be
   * ORed across pairs and ANDed within a signal and products pair.
   */
  signalProductsFilters?: SignalProductsFilters[];
}

/**
 * QueryIssuesResponse is the response containing a list of issues.
 */
export interface QueryIssuesResponse {
  /**
   * A token that can be sent as `page_token` to retrieve the next page. If
   * this field is omitted, there are no subsequent pages.
   */
  nextPageToken?: string;
  /**
   * List of issues and resource details.
   */
  resourceIssues?: DatabaseResourceIssue[];
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

function serializeQueryIssuesResponse(data: any): QueryIssuesResponse {
  return {
    ...data,
    resourceIssues: data["resourceIssues"] !== undefined ? data["resourceIssues"].map((item: any) => (serializeDatabaseResourceIssue(item))) : undefined,
  };
}

function deserializeQueryIssuesResponse(data: any): QueryIssuesResponse {
  return {
    ...data,
    resourceIssues: data["resourceIssues"] !== undefined ? data["resourceIssues"].map((item: any) => (deserializeDatabaseResourceIssue(item))) : undefined,
  };
}

/**
 * QueryMetrics contains the metrics related to the query execution.
 */
export interface QueryMetrics {
  /**
   * The average execution period of the query across all runs.
   */
  avgCpuTime?: number /* Duration */;
  /**
   * The number of times the query was executed.
   */
  executionCount?: bigint;
  /**
   * The window over which the metrics are aggregated.
   */
  metricsWindow?:  | "METRICS_WINDOW_UNSPECIFIED" | "LAST_ONE_DAY" | "LAST_ONE_WEEK" | "LAST_TWO_WEEKS";
  /**
   * The average number of rows processed by the query across all runs.
   */
  rowsProcessed?: bigint;
  /**
   * The total CPU time consumed by the query across all runs.
   */
  totalCpuTime?: number /* Duration */;
}

function serializeQueryMetrics(data: any): QueryMetrics {
  return {
    ...data,
    avgCpuTime: data["avgCpuTime"] !== undefined ? data["avgCpuTime"] : undefined,
    executionCount: data["executionCount"] !== undefined ? String(data["executionCount"]) : undefined,
    rowsProcessed: data["rowsProcessed"] !== undefined ? String(data["rowsProcessed"]) : undefined,
    totalCpuTime: data["totalCpuTime"] !== undefined ? data["totalCpuTime"] : undefined,
  };
}

function deserializeQueryMetrics(data: any): QueryMetrics {
  return {
    ...data,
    avgCpuTime: data["avgCpuTime"] !== undefined ? data["avgCpuTime"] : undefined,
    executionCount: data["executionCount"] !== undefined ? BigInt(data["executionCount"]) : undefined,
    rowsProcessed: data["rowsProcessed"] !== undefined ? BigInt(data["rowsProcessed"]) : undefined,
    totalCpuTime: data["totalCpuTime"] !== undefined ? data["totalCpuTime"] : undefined,
  };
}

/**
 * QueryProductsResponse represents the response containing a list of products.
 */
export interface QueryProductsResponse {
  /**
   * A token that can be sent as `page_token` to retrieve the next page. If
   * this field is omitted, there are no subsequent pages
   */
  nextPageToken?: string;
  /**
   * List of database products returned.
   */
  products?: Product[];
  /**
   * Unordered list. List of unreachable regions from where data could not be
   * retrieved.
   */
  unreachable?: string[];
}

/**
 * QueryStats contains the stats for a particular combination of query_hash,
 * query_string and resource_type.
 */
export interface QueryStats {
  /**
   * Information about inefficient query.
   */
  inefficientQueryInfo?: InefficientQueryInfo;
  /**
   * The query string is normalized query without any PII data.
   */
  normalizedQuery?: string;
  /**
   * The query hash of the query.
   */
  queryHash?: string;
  /**
   * Metrics related to the query performance.
   */
  queryMetrics?: QueryMetrics;
  /**
   * The resource ids for which the query stats are collected.
   */
  resourceIds?: ResourceId[];
  /**
   * The type of the resource. sqladmin.googleapis.com/Instance
   * alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
   */
  resourceType?: string;
}

function serializeQueryStats(data: any): QueryStats {
  return {
    ...data,
    inefficientQueryInfo: data["inefficientQueryInfo"] !== undefined ? serializeInefficientQueryInfo(data["inefficientQueryInfo"]) : undefined,
    queryMetrics: data["queryMetrics"] !== undefined ? serializeQueryMetrics(data["queryMetrics"]) : undefined,
  };
}

function deserializeQueryStats(data: any): QueryStats {
  return {
    ...data,
    inefficientQueryInfo: data["inefficientQueryInfo"] !== undefined ? deserializeInefficientQueryInfo(data["inefficientQueryInfo"]) : undefined,
    queryMetrics: data["queryMetrics"] !== undefined ? deserializeQueryMetrics(data["queryMetrics"]) : undefined,
  };
}

/**
 * QueryStatsInfo contains the aggregated and detailed query stats for a
 * particular combination of relevant query stats for queries having same
 * normalized query.
 */
export interface QueryStatsInfo {
  /**
   * Aggregated query stats for the resources for same normalized query.
   */
  aggregatedQueryStats?: QueryStats;
  /**
   * List of query stats for the resources in the group. This stats is stats at
   * resource level for the resources having same normalized query.
   */
  queryStats?: QueryStats[];
}

function serializeQueryStatsInfo(data: any): QueryStatsInfo {
  return {
    ...data,
    aggregatedQueryStats: data["aggregatedQueryStats"] !== undefined ? serializeQueryStats(data["aggregatedQueryStats"]) : undefined,
    queryStats: data["queryStats"] !== undefined ? data["queryStats"].map((item: any) => (serializeQueryStats(item))) : undefined,
  };
}

function deserializeQueryStatsInfo(data: any): QueryStatsInfo {
  return {
    ...data,
    aggregatedQueryStats: data["aggregatedQueryStats"] !== undefined ? deserializeQueryStats(data["aggregatedQueryStats"]) : undefined,
    queryStats: data["queryStats"] !== undefined ? data["queryStats"].map((item: any) => (deserializeQueryStats(item))) : undefined,
  };
}

/**
 * Info associated with recommendation.
 */
export interface RecommendationInfo {
  /**
   * Name of recommendation. Examples:
   * organizations/1234/locations/us-central1/recommenders/google.cloudsql.instance.PerformanceRecommender/recommendations/9876
   */
  recommender?: string;
  /**
   * ID of recommender. Examples:
   * "google.cloudsql.instance.PerformanceRecommender"
   */
  recommenderId?: string;
  /**
   * Contains an identifier for a subtype of recommendations produced for the
   * same recommender. Subtype is a function of content and impact, meaning a
   * new subtype might be added when significant changes to `content` or
   * `primary_impact.category` are introduced. See the Recommenders section to
   * see a list of subtypes for a given Recommender. Examples: For recommender =
   * "google.cloudsql.instance.PerformanceRecommender", recommender_subtype can
   * be
   * "MYSQL_HIGH_NUMBER_OF_OPEN_TABLES_BEST_PRACTICE"/"POSTGRES_HIGH_TRANSACTION_ID_UTILIZATION_BEST_PRACTICE"
   */
  recommenderSubtype?: string;
}

/**
 * Compliances associated with signals.
 */
export interface RegulatoryStandard {
  /**
   * Name of industry compliance standards, such as such as CIS, PCI, and
   * OWASP.
   */
  standard?: string;
  /**
   * Version of the standard or benchmark, for example, 1.1.
   */
  version?: string;
}

/**
 * Capture the resource details for resources that are included in the delta
 * counts.
 */
export interface ResourceDetails {
  /**
   * Specifies where the resource is created. For Google Cloud resources, it is
   * the full name of the project.
   */
  container?: string;
  /**
   * Full resource name of the resource.
   */
  fullResourceName?: string;
  /**
   * Location of the resource.
   */
  location?: string;
  /**
   * Product type of the resource.
   */
  product?: Product;
}

/**
 * ResourceId contains the identifier for a database resource, including the
 * full resource name, resource type, and product.
 */
export interface ResourceId {
  /**
   * The full resource name of the resource.
   */
  fullResourceName?: string;
  /**
   * The product of the resource, including the type, engine, and version.
   */
  product?: Product;
  /**
   * The type of the resource. sqladmin.googleapis.com/Instance
   * alloydb.googleapis.com/Cluster alloydb.googleapis.com/Instance
   */
  resourceType?: string;
}

/**
 * Deny maintenance period for the database resource. It specifies the time
 * range during which the maintenance cannot start. This is configured by the
 * customer.
 */
export interface ResourceMaintenanceDenySchedule {
  /**
   * Optional. Deny period end date.
   */
  endDate?: Date;
  /**
   * Optional. The start date of the deny maintenance period.
   */
  startDate?: Date;
  /**
   * Optional. Time in UTC when the deny period starts on start_date and ends
   * on end_date.
   */
  time?: TimeOfDay;
}

/**
 * Maintenance window for the database resource. It specifies preferred time
 * and day of the week and phase in some cases, when the maintenance can start.
 */
export interface ResourceMaintenanceSchedule {
  /**
   * Optional. Preferred day of the week for maintenance, e.g. MONDAY, TUESDAY,
   * etc.
   */
  day?:  | "DAY_OF_WEEK_UNSPECIFIED" | "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
  /**
   * Optional. Phase of the maintenance window. This is to capture order of
   * maintenance. For example, for Cloud SQL resources, this can be used to
   * capture if the maintenance window is in Week1, Week2, Week5, etc. Non
   * production resources are usually part of early phase. For more details,
   * refer to Cloud SQL resources -
   * https://cloud.google.com/sql/docs/mysql/maintenance
   */
  phase?:  | "PHASE_UNSPECIFIED" | "PHASE_WEEK1" | "PHASE_WEEK2" | "PHASE_WEEK5" | "PHASE_ANY";
  /**
   * Optional. Preferred time to start the maintenance operation on the
   * specified day.
   */
  startTime?: TimeOfDay;
}

/**
 * Resource suspension info for a database resource.
 */
export interface ResourceSuspensionInfo {
  /**
   * Is resource suspended.
   */
  resourceSuspended?: boolean;
  /**
   * Suspension reason for the resource.
   */
  suspensionReason?:  | "SUSPENSION_REASON_UNSPECIFIED" | "WIPEOUT_HIDE_EVENT" | "WIPEOUT_PURGE_EVENT" | "BILLING_DISABLED" | "ABUSER_DETECTED" | "ENCRYPTION_KEY_INACCESSIBLE" | "REPLICATED_CLUSTER_ENCRYPTION_KEY_INACCESSIBLE";
}

/**
 * Metadata about backup retention settings for a database resource.
 */
export interface RetentionSettingsInfo {
  /**
   * Duration based retention period i.e. 172800 seconds (2 days)
   */
  durationBasedRetention?: number /* Duration */;
  /**
   * Number of backups that will be retained.
   */
  quantityBasedRetention?: number;
  /**
   * Optional. Sub resource details associated with the backup configuration.
   */
  subResource?: SubResource;
  /**
   * Timestamp based retention period i.e. till 2024-05-01T00:00:00Z
   */
  timestampBasedRetentionTime?: Date;
}

function serializeRetentionSettingsInfo(data: any): RetentionSettingsInfo {
  return {
    ...data,
    durationBasedRetention: data["durationBasedRetention"] !== undefined ? data["durationBasedRetention"] : undefined,
    timestampBasedRetentionTime: data["timestampBasedRetentionTime"] !== undefined ? data["timestampBasedRetentionTime"].toISOString() : undefined,
  };
}

function deserializeRetentionSettingsInfo(data: any): RetentionSettingsInfo {
  return {
    ...data,
    durationBasedRetention: data["durationBasedRetention"] !== undefined ? data["durationBasedRetention"] : undefined,
    timestampBasedRetentionTime: data["timestampBasedRetentionTime"] !== undefined ? new Date(data["timestampBasedRetentionTime"]) : undefined,
  };
}

/**
 * Info associated with SCC signals.
 */
export interface SCCInfo {
  /**
   * Name by which SCC calls this signal.
   */
  category?: string;
  /**
   * External URI which points to a SCC page associated with the signal.
   */
  externalUri?: string;
  /**
   * Compliances that are associated with the signal.
   */
  regulatoryStandards?: RegulatoryStandard[];
  /**
   * Name of the signal.
   */
  signal?: string;
}

/**
 * Represents a signal.
 */
export interface Signal {
  /**
   * Additional information related to the signal. In the case of composite
   * signals, this field encapsulates details associated with granular signals,
   * having a signal status of "ISSUE"; signals with a status of "OK" are not
   * included. For granular signals, it encompasses information relevant to the
   * signal, regardless of the signal status.
   */
  additionalDetails?: AdditionalDetail[];
  /**
   * Timestamp when the issue was created (when signal status is ISSUE).
   */
  issueCreateTime?: Date;
  /**
   * Severity of the issue.
   */
  issueSeverity?:  | "ISSUE_SEVERITY_UNSPECIFIED" | "ISSUE_SEVERITY_LOW" | "ISSUE_SEVERITY_MEDIUM" | "ISSUE_SEVERITY_HIGH" | "ISSUE_SEVERITY_CRITICAL" | "ISSUE_SEVERITY_IRRELEVANT";
  /**
   * Status of the signal.
   */
  signalStatus?:  | "SIGNAL_STATUS_UNSPECIFIED" | "SIGNAL_STATUS_NOT_APPLICABLE" | "SIGNAL_STATUS_OK" | "SIGNAL_STATUS_ISSUE" | "SIGNAL_STATUS_NOT_ENABLED";
  /**
   * Type of the signal.
   */
  signalType?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE";
}

function serializeSignal(data: any): Signal {
  return {
    ...data,
    additionalDetails: data["additionalDetails"] !== undefined ? data["additionalDetails"].map((item: any) => (serializeAdditionalDetail(item))) : undefined,
    issueCreateTime: data["issueCreateTime"] !== undefined ? data["issueCreateTime"].toISOString() : undefined,
  };
}

function deserializeSignal(data: any): Signal {
  return {
    ...data,
    additionalDetails: data["additionalDetails"] !== undefined ? data["additionalDetails"].map((item: any) => (deserializeAdditionalDetail(item))) : undefined,
    issueCreateTime: data["issueCreateTime"] !== undefined ? new Date(data["issueCreateTime"]) : undefined,
  };
}

/**
 * A filter for Signals. If signal_type is left unset, all signals should be
 * returned. For example, the following filter returns all issues.
 * signal_filter: { signal_status: SIGNAL_STATUS_ISSUE; } Another example, the
 * following filter returns issues of the given type: signal_filter: { type:
 * SIGNAL_TYPE_NO_PROMOTABLE_REPLICA signal_status: ISSUE } If signal_status is
 * left unset or set to SIGNAL_STATE_UNSPECIFIED, an error should be returned.
 */
export interface SignalFilter {
  /**
   * Optional. Represents the status of the Signal for which the filter is for.
   */
  signalStatus?:  | "SIGNAL_STATUS_UNSPECIFIED" | "SIGNAL_STATUS_NOT_APPLICABLE" | "SIGNAL_STATUS_OK" | "SIGNAL_STATUS_ISSUE" | "SIGNAL_STATUS_NOT_ENABLED";
  /**
   * Optional. Represents the type of the Signal for which the filter is for.
   */
  signalType?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE";
}

/**
 * A group of signals and their counts.
 */
export interface SignalGroup {
  /**
   * Title of a signal group corresponding to the request.
   */
  displayName?: string;
  /**
   * When applied to a DatabaseResource represents count of issues associated
   * with the resource. A signal is an issue when its SignalStatus field is set
   * to SIGNAL_STATUS_ISSUE.
   */
  issueCount?: number;
  /**
   * List of signals present in the group and associated with the resource.
   * Only applies to a DatabaseResource.
   */
  signals?: Signal[];
}

function serializeSignalGroup(data: any): SignalGroup {
  return {
    ...data,
    signals: data["signals"] !== undefined ? data["signals"].map((item: any) => (serializeSignal(item))) : undefined,
  };
}

function deserializeSignalGroup(data: any): SignalGroup {
  return {
    ...data,
    signals: data["signals"] !== undefined ? data["signals"].map((item: any) => (deserializeSignal(item))) : undefined,
  };
}

/**
 * SignalProductsFilters represents a signal and list of supported products.
 */
export interface SignalProductsFilters {
  /**
   * Optional. Product type of the resource. The version of the product will be
   * ignored in filtering.
   */
  products?: Product[];
  /**
   * Optional. The type of signal.
   */
  signalType?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE";
}

/**
 * A group of signal types that specifies what the user is interested in. Used
 * by QueryDatabaseResourceGroups API. Example: signal_type_group { name =
 * "AVAILABILITY" types = [SIGNAL_TYPE_NO_PROMOTABLE_REPLICA] }
 */
export interface SignalTypeGroup {
  /**
   * Required. The display name of a signal group.
   */
  displayName?: string;
  /**
   * Optional. List of signal types present in the group.
   */
  signalTypes?:  | "SIGNAL_TYPE_UNSPECIFIED" | "SIGNAL_TYPE_RESOURCE_FAILOVER_PROTECTED" | "SIGNAL_TYPE_GROUP_MULTIREGIONAL" | "SIGNAL_TYPE_NO_AUTOMATED_BACKUP_POLICY" | "SIGNAL_TYPE_SHORT_BACKUP_RETENTION" | "SIGNAL_TYPE_LAST_BACKUP_FAILED" | "SIGNAL_TYPE_LAST_BACKUP_OLD" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_2_0" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_3" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_2" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_1" | "SIGNAL_TYPE_VIOLATES_CIS_GCP_FOUNDATION_1_0" | "SIGNAL_TYPE_VIOLATES_CIS_CONTROLS_V8_0" | "SIGNAL_TYPE_VIOLATES_NIST_800_53" | "SIGNAL_TYPE_VIOLATES_NIST_800_53_R5" | "SIGNAL_TYPE_VIOLATES_NIST_CYBERSECURITY_FRAMEWORK_V1_0" | "SIGNAL_TYPE_VIOLATES_ISO_27001" | "SIGNAL_TYPE_VIOLATES_ISO_27001_V2022" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V3_2_1" | "SIGNAL_TYPE_VIOLATES_PCI_DSS_V4_0" | "SIGNAL_TYPE_VIOLATES_CLOUD_CONTROLS_MATRIX_V4" | "SIGNAL_TYPE_VIOLATES_HIPAA" | "SIGNAL_TYPE_VIOLATES_SOC2_V2017" | "SIGNAL_TYPE_LOGS_NOT_OPTIMIZED_FOR_TROUBLESHOOTING" | "SIGNAL_TYPE_QUERY_DURATIONS_NOT_LOGGED" | "SIGNAL_TYPE_VERBOSE_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_LOCK_WAITS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_MOST_ERRORS" | "SIGNAL_TYPE_LOGGING_ONLY_CRITICAL_ERRORS" | "SIGNAL_TYPE_MINIMAL_ERROR_LOGGING" | "SIGNAL_TYPE_QUERY_STATS_LOGGED" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_CLIENT_HOSTNAME" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PARSER_STATS" | "SIGNAL_TYPE_EXCESSIVE_LOGGING_OF_PLANNER_STATS" | "SIGNAL_TYPE_NOT_LOGGING_ONLY_DDL_STATEMENTS" | "SIGNAL_TYPE_LOGGING_QUERY_STATS" | "SIGNAL_TYPE_NOT_LOGGING_TEMPORARY_FILES" | "SIGNAL_TYPE_CONNECTION_MAX_NOT_CONFIGURED" | "SIGNAL_TYPE_USER_OPTIONS_CONFIGURED" | "SIGNAL_TYPE_EXPOSED_TO_PUBLIC_ACCESS" | "SIGNAL_TYPE_UNENCRYPTED_CONNECTIONS" | "SIGNAL_TYPE_NO_ROOT_PASSWORD" | "SIGNAL_TYPE_WEAK_ROOT_PASSWORD" | "SIGNAL_TYPE_ENCRYPTION_KEY_NOT_CUSTOMER_MANAGED" | "SIGNAL_TYPE_SERVER_AUTHENTICATION_NOT_REQUIRED" | "SIGNAL_TYPE_EXPOSED_TO_EXTERNAL_SCRIPTS" | "SIGNAL_TYPE_EXPOSED_TO_LOCAL_DATA_LOADS" | "SIGNAL_TYPE_CONNECTION_ATTEMPTS_NOT_LOGGED" | "SIGNAL_TYPE_DISCONNECTIONS_NOT_LOGGED" | "SIGNAL_TYPE_LOGGING_EXCESSIVE_STATEMENT_INFO" | "SIGNAL_TYPE_EXPOSED_TO_REMOTE_ACCESS" | "SIGNAL_TYPE_DATABASE_NAMES_EXPOSED" | "SIGNAL_TYPE_SENSITIVE_TRACE_INFO_NOT_MASKED" | "SIGNAL_TYPE_PUBLIC_IP_ENABLED" | "SIGNAL_TYPE_IDLE" | "SIGNAL_TYPE_OVERPROVISIONED" | "SIGNAL_TYPE_HIGH_NUMBER_OF_OPEN_TABLES" | "SIGNAL_TYPE_HIGH_NUMBER_OF_TABLES" | "SIGNAL_TYPE_HIGH_TRANSACTION_ID_UTILIZATION" | "SIGNAL_TYPE_UNDERPROVISIONED" | "SIGNAL_TYPE_OUT_OF_DISK" | "SIGNAL_TYPE_SERVER_CERTIFICATE_NEAR_EXPIRY" | "SIGNAL_TYPE_DATABASE_AUDITING_DISABLED" | "SIGNAL_TYPE_RESTRICT_AUTHORIZED_NETWORKS" | "SIGNAL_TYPE_VIOLATE_POLICY_RESTRICT_PUBLIC_IP" | "SIGNAL_TYPE_QUOTA_LIMIT" | "SIGNAL_TYPE_NO_PASSWORD_POLICY" | "SIGNAL_TYPE_CONNECTIONS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TMP_TABLES_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_TRANS_LOGS_PERFORMANCE_IMPACT" | "SIGNAL_TYPE_HIGH_JOINS_WITHOUT_INDEXES" | "SIGNAL_TYPE_SUPERUSER_WRITING_TO_USER_TABLES" | "SIGNAL_TYPE_USER_GRANTED_ALL_PERMISSIONS" | "SIGNAL_TYPE_DATA_EXPORT_TO_EXTERNAL_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_DATA_EXPORT_TO_PUBLIC_CLOUD_STORAGE_BUCKET" | "SIGNAL_TYPE_WEAK_PASSWORD_HASH_ALGORITHM" | "SIGNAL_TYPE_NO_USER_PASSWORD_POLICY" | "SIGNAL_TYPE_HOT_NODE" | "SIGNAL_TYPE_NO_DELETION_PROTECTION" | "SIGNAL_TYPE_NO_POINT_IN_TIME_RECOVERY" | "SIGNAL_TYPE_RESOURCE_SUSPENDED" | "SIGNAL_TYPE_EXPENSIVE_COMMANDS" | "SIGNAL_TYPE_NO_MAINTENANCE_POLICY_CONFIGURED" | "SIGNAL_TYPE_INEFFICIENT_QUERY" | "SIGNAL_TYPE_READ_INTENSIVE_WORKLOAD" | "SIGNAL_TYPE_MEMORY_LIMIT" | "SIGNAL_TYPE_MAX_SERVER_MEMORY" | "SIGNAL_TYPE_LARGE_ROWS" | "SIGNAL_TYPE_HIGH_WRITE_PRESSURE" | "SIGNAL_TYPE_HIGH_READ_PRESSURE" | "SIGNAL_TYPE_ENCRYPTION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_LOCATION_ORG_POLICY_NOT_SATISFIED" | "SIGNAL_TYPE_OUTDATED_MINOR_VERSION" | "SIGNAL_TYPE_SCHEMA_NOT_OPTIMIZED" | "SIGNAL_TYPE_REPLICATION_LAG" | "SIGNAL_TYPE_OUTDATED_CLIENT" | "SIGNAL_TYPE_DATABOOST_DISABLED" | "SIGNAL_TYPE_RECOMMENDED_MAINTENANCE_POLICIES" | "SIGNAL_TYPE_EXTENDED_SUPPORT" | "SIGNAL_TYPE_VERSION_NEARING_END_OF_LIFE"[];
}

/**
 * Sub resource details For Spanner/Bigtable instance certain data protection
 * settings are at sub resource level like database/table. This message is used
 * to capture such sub resource details.
 */
export interface SubResource {
  /**
   * Specifies where the resource is created. For Google Cloud resources, it is
   * the full name of the project.
   */
  container?: string;
  /**
   * Optional. Resource name associated with the sub resource where backup
   * settings are configured.
   * E.g."//spanner.googleapis.com/projects/project1/instances/inst1/databases/db1"
   * for Spanner where backup retention is configured on database within an
   * instance OPTIONAL
   */
  fullResourceName?: string;
  /**
   * Optional. Product information associated with the sub resource where
   * backup retention settings are configured. e.g. ``` product: { type :
   * PRODUCT_TYPE_SPANNER engine : ENGINE_CLOUD_SPANNER_WITH_POSTGRES_DIALECT }
   * ``` for Spanner where backup is configured on database within an instance
   * OPTIONAL
   */
  product?: Product;
  /**
   * Optional. Resource type associated with the sub resource where backup
   * settings are configured. E.g. "spanner.googleapis.com/Database" for Spanner
   * where backup retention is configured on database within an instance
   * OPTIONAL
   */
  resourceType?: string;
}

/**
 * Tag is a key value pair attached to a resource.
 */
export interface Tag {
  /**
   * Indicates the inheritance status of a tag value attached to the given
   * resource. If the tag value is inherited from one of the resource's
   * ancestors, inherited will be true. If false, then the tag value is directly
   * attached to the resource.
   */
  inherited?: boolean;
  key?: string;
  /**
   * The source of the tag. According to
   * https://cloud.google.com/resource-manager/docs/tags/tags-overview#tags_and_labels,
   * tags can be created only at the project or organization level. Tags can be
   * inherited from different project as well not just the current project where
   * the database resource is present. Format: "projects/{PROJECT_ID}",
   * "projects/{PROJECT_NUMBER}", "organizations/{ORGANIZATION_ID}"
   */
  source?: string;
  /**
   * The value part of the tag.
   */
  value?: string;
}

/**
 * Represents a time of day. The date and time zone are either not significant
 * or are specified elsewhere. An API may choose to allow leap seconds. Related
 * types are google.type.Date and `google.protobuf.Timestamp`.
 */
export interface TimeOfDay {
  /**
   * Hours of a day in 24 hour format. Must be greater than or equal to 0 and
   * typically must be less than or equal to 23. An API may choose to allow the
   * value "24:00:00" for scenarios like business closing time.
   */
  hours?: number;
  /**
   * Minutes of an hour. Must be greater than or equal to 0 and less than or
   * equal to 59.
   */
  minutes?: number;
  /**
   * Fractions of seconds, in nanoseconds. Must be greater than or equal to 0
   * and less than or equal to 999,999,999.
   */
  nanos?: number;
  /**
   * Seconds of a minute. Must be greater than or equal to 0 and typically must
   * be less than or equal to 59. An API may allow the value 60 if it allows
   * leap-seconds.
   */
  seconds?: number;
}

/**
 * TypedValue represents the value of the metric based on data type.
 */
export interface TypedValue {
  /**
   * The value of the metric as double.
   */
  doubleValue?: number;
  /**
   * The value of the metric as int.
   */
  int64Value?: bigint;
}

function serializeTypedValue(data: any): TypedValue {
  return {
    ...data,
    int64Value: data["int64Value"] !== undefined ? String(data["int64Value"]) : undefined,
  };
}

function deserializeTypedValue(data: any): TypedValue {
  return {
    ...data,
    int64Value: data["int64Value"] !== undefined ? BigInt(data["int64Value"]) : undefined,
  };
}

/**
 * Upcoming maintenance window for the database resource.
 */
export interface UpcomingMaintenance {
  /**
   * Output only. End time of the upcoming maintenance. This is only populated
   * for an engine, if end time is public for the engine.
   */
  readonly endTime?: Date;
  /**
   * Output only. Start time of the upcoming maintenance. Start time is always
   * populated when an upcoming maintenance is scheduled.
   */
  readonly startTime?: Date;
}

/**
 * Additional options for DatabaseCenter#v1betaAggregateFleet.
 */
export interface V1betaAggregateFleetOptions {
  /**
   * Day of a month. Must be from 1 to 31 and valid for the year and month, or
   * 0 to specify a year by itself or a year and month where the day isn't
   * significant.
   */
  ["baselineDate.day"]?: number;
  /**
   * Month of a year. Must be from 1 to 12, or 0 to specify a year without a
   * month and day.
   */
  ["baselineDate.month"]?: number;
  /**
   * Year of the date. Must be from 1 to 9999, or 0 to specify a date without a
   * year.
   */
  ["baselineDate.year"]?: number;
  /**
   * Optional. The expression to filter resources. Supported fields are:
   * `full_resource_name`, `resource_type`, `container`, `product.type`,
   * `product.engine`, `product.version`, `location`, `labels`, `issues`, fields
   * of availability_info, data_protection_info, 'resource_name', etc. The
   * expression is a list of zero or more restrictions combined via logical
   * operators `AND` and `OR`. When `AND` and `OR` are both used in the
   * expression, parentheses must be appropriately used to group the
   * combinations. Example: `location="us-east1"` Example:
   * `container="projects/123" OR container="projects/456"` Example:
   * `(container="projects/123" OR container="projects/456") AND
   * location="us-east1"`
   */
  filter?: string;
  /**
   * Optional. A field that statistics are grouped by. Valid values are any
   * combination of the following: * container * product.type * product.engine *
   * product.version * location * sub_resource_type * management_type * tag.key
   * * tag.value * tag.source * tag.inherited * label.key * label.value *
   * label.source * has_maintenance_schedule * has_deny_maintenance_schedules
   * Comma separated list.
   */
  groupBy?: string;
  /**
   * Optional. Valid values to order by are: * resource_groups_count *
   * resources_count * and all fields supported by `group_by` The default order
   * is ascending. Add "DESC" after the field name to indicate descending order.
   * Add "ASC" after the field name to indicate ascending order. It supports
   * ordering using multiple fields. For example: `order_by =
   * "resource_groups_count"` sorts response in ascending order `order_by =
   * "resource_groups_count DESC"` sorts response in descending order `order_by
   * = "product.type, product.version DESC, location"` orders by type in
   * ascending order, version in descending order and location in ascending
   * order
   */
  orderBy?: string;
  /**
   * Optional. If unspecified, at most 50 items will be returned. The maximum
   * value is 1000; values above 1000 will be coerced to 1000.
   */
  pageSize?: number;
  /**
   * Optional. A page token, received from a previous `AggregateFleet` call.
   * Provide this to retrieve the subsequent page. All other parameters should
   * match the parameters in the call that provided the page token except for
   * page_size which can be different.
   */
  pageToken?: string;
  /**
   * Required. Parent can be a project, a folder, or an organization. The
   * search is limited to the resources within the `scope`. The allowed values
   * are: * projects/{PROJECT_ID} (e.g., "projects/foo-bar") *
   * projects/{PROJECT_NUMBER} (e.g., "projects/12345678") *
   * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") *
   * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  parent?: string;
}

/**
 * Additional options for DatabaseCenter#v1betaQueryProducts.
 */
export interface V1betaQueryProductsOptions {
  /**
   * Optional. If unspecified, at most 50 products will be returned. The
   * maximum value is 1000; values above 1000 will be coerced to 1000.
   */
  pageSize?: number;
  /**
   * Optional. A page token, received from a previous `ListLocations` call.
   * Provide this to retrieve the subsequent page. All other parameters except
   * page size should match the call that provided the page page token.
   */
  pageToken?: string;
  /**
   * Required. Parent can be a project, a folder, or an organization. The
   * allowed values are: * projects/{PROJECT_ID}/locations/{LOCATION}
   * (e.g.,"projects/foo-bar/locations/us-central1") *
   * projects/{PROJECT_NUMBER}/locations/{LOCATION}
   * (e.g.,"projects/12345678/locations/us-central1") *
   * folders/{FOLDER_NUMBER}/locations/{LOCATION}
   * (e.g.,"folders/1234567/locations/us-central1") *
   * organizations/{ORGANIZATION_NUMBER}/locations/{LOCATION}
   * (e.g.,"organizations/123456/locations/us-central1") * projects/{PROJECT_ID}
   * (e.g., "projects/foo-bar") * projects/{PROJECT_NUMBER} (e.g.,
   * "projects/12345678") * folders/{FOLDER_NUMBER} (e.g., "folders/1234567") *
   * organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/123456")
   */
  parent?: string;
}