// Copyright 2022 Luca Casonato. All rights reserved. MIT license. /** * Connectors API Client for Deno * ============================== * * Enables users to create and manage connections to Google Cloud services and third-party business applications using the Connectors interface. * * Docs: https://cloud.google.com/apigee/docs/api-platform/connectors/about-connectors * Source: https://googleapis.deno.dev/v1/connectors:v2.ts */ import { auth, CredentialsClient, GoogleAuth, request } from "/_/base@v1/mod.ts"; export { auth, GoogleAuth }; export type { CredentialsClient }; /** * Enables users to create and manage connections to Google Cloud services and * third-party business applications using the Connectors interface. */ export class Connectors { #client: CredentialsClient | undefined; #baseUrl: string; constructor(client?: CredentialsClient, baseUrl: string = "https://connectors.googleapis.com/") { this.#client = client; this.#baseUrl = baseUrl; } /** * Executes an action with the name specified in the request. The input * parameters for executing the action are passed through the body of the * ExecuteAction request. * * @param name Required. Resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection}/actions/{action} */ async projectsLocationsConnectionsActionsExecute(name: string, req: ExecuteActionRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:execute`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as ExecuteActionResponse; } /** * Gets the schema of the given action. * * @param name Required. Resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection}/actions/{action} */ async projectsLocationsConnectionsActionsGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Action; } /** * Gets the schema of all the actions supported by the connector. * * @param parent Required. Parent resource name of the Action. Format: projects/{project}/locations/{location}/connections/{connection} */ async projectsLocationsConnectionsActionsList(parent: string, opts: ProjectsLocationsConnectionsActionsListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/actions`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListActionsResponse; } /** * Reports readiness status of the connector. Similar logic to GetStatus but * modified for kubernetes health check to understand. * */ async projectsLocationsConnectionsCheckReadiness(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:checkReadiness`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as CheckReadinessResponse; } /** * Reports the status of the connection. Note that when the connection is in * a state that is not ACTIVE, the implementation of this RPC method must * return a Status with the corresponding State instead of returning a gRPC * status code that is not "OK", which indicates that ConnectionStatus itself, * not the connection, failed. * */ async projectsLocationsConnectionsCheckStatus(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:checkStatus`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as CheckStatusResponse; } /** * Creates a new entity row of the specified entity type in the external * system. The field values for creating the row are contained in the body of * the request. The response message contains a `Entity` message object * returned as a response by the external system. * * @param parent Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */ async projectsLocationsConnectionsEntityTypesEntitiesCreate(parent: string, req: Entity): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/entities`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as Entity; } /** * Deletes an existing entity row matching the entity type and entity id * specified in the request. * * @param name Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */ async projectsLocationsConnectionsEntityTypesEntitiesDelete(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "DELETE", }); return data as Empty; } /** * Deletes entities based on conditions specified in the request and not on * entity id. * * @param entityType Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */ async projectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditions(entityType: string, opts: ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ entityType }/entities:deleteEntitiesWithConditions`); if (opts.conditions !== undefined) { url.searchParams.append("conditions", String(opts.conditions)); } const data = await request(url.href, { client: this.#client, method: "POST", }); return data as Empty; } /** * Gets a single entity row matching the entity type and entity id specified * in the request. * * @param name Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */ async projectsLocationsConnectionsEntityTypesEntitiesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as Entity; } /** * Lists entity rows of a particular entity type contained in the request. * Note: 1. Currently, only max of one 'sort_by' column is supported. 2. If no * 'sort_by' column is provided, the primary key of the table is used. If zero * or more than one primary key is available, we default to the unpaginated * list entities logic which only returns the first page. 3. The values of the * 'sort_by' columns must uniquely identify an entity row, otherwise undefined * behaviors may be observed during pagination. 4. Since transactions are not * supported, any updates, inserts or deletes during pagination can lead to * stale data being returned or other unexpected behaviors. * * @param parent Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */ async projectsLocationsConnectionsEntityTypesEntitiesList(parent: string, opts: ProjectsLocationsConnectionsEntityTypesEntitiesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/entities`); if (opts.conditions !== undefined) { url.searchParams.append("conditions", String(opts.conditions)); } if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.sortBy !== undefined) { url.searchParams.append("sortBy", String(opts.sortBy)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListEntitiesResponse; } /** * Updates an existing entity row matching the entity type and entity id * specified in the request. The fields in the entity row that need to be * modified are contained in the body of the request. All unspecified fields * are left unchanged. The response message contains a `Entity` message object * returned as a response by the external system. * * @param name Output only. Resource name of the Entity. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */ async projectsLocationsConnectionsEntityTypesEntitiesPatch(name: string, req: Entity): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "PATCH", body, }); return data as Entity; } /** * Updates entities based on conditions specified in the request and not on * entity id. * * @param entityType Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type} */ async projectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditions(entityType: string, req: Entity, opts: ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ entityType }/entities:updateEntitiesWithConditions`); if (opts.conditions !== undefined) { url.searchParams.append("conditions", String(opts.conditions)); } const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as UpdateEntitiesWithConditionsResponse; } /** * Gets metadata of given entity type * * @param name Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection}/entityTypes/{entityType} */ async projectsLocationsConnectionsEntityTypesGet(name: string): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }`); const data = await request(url.href, { client: this.#client, method: "GET", }); return data as EntityType; } /** * Lists metadata related to all entity types present in the external system. * * @param parent Required. Resource name of the Entity Type. Format: projects/{project}/locations/{location}/connections/{connection} */ async projectsLocationsConnectionsEntityTypesList(parent: string, opts: ProjectsLocationsConnectionsEntityTypesListOptions = {}): Promise { const url = new URL(`${this.#baseUrl}v2/${ parent }/entityTypes`); if (opts.pageSize !== undefined) { url.searchParams.append("pageSize", String(opts.pageSize)); } if (opts.pageToken !== undefined) { url.searchParams.append("pageToken", String(opts.pageToken)); } if (opts.view !== undefined) { url.searchParams.append("view", String(opts.view)); } const data = await request(url.href, { client: this.#client, method: "GET", }); return data as ListEntityTypesResponse; } /** * ExchangeAuthCode exchanges the OAuth authorization code (and other * necessary data) for an access token (and associated credentials). * */ async projectsLocationsConnectionsExchangeAuthCode(name: string, req: ExchangeAuthCodeRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:exchangeAuthCode`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeExchangeAuthCodeResponse(data); } /** * Executes a SQL statement specified in the body of the request. An example * of this SQL statement in the case of Salesforce connector would be 'select * * from Account a, Order o where a.Id = o.AccountId'. * * @param connection Required. Resource name of the Connection. Format: projects/{project}/locations/{location}/connections/{connection} */ async projectsLocationsConnectionsExecuteSqlQuery(connection: string, req: ExecuteSqlQueryRequest): Promise { req = serializeExecuteSqlQueryRequest(req); const url = new URL(`${this.#baseUrl}v2/${ connection }:executeSqlQuery`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return data as ExecuteSqlQueryResponse; } /** * RefreshAccessToken exchanges the OAuth refresh token (and other necessary * data) for a new access token (and new associated credentials). * */ async projectsLocationsConnectionsRefreshAccessToken(name: string, req: RefreshAccessTokenRequest): Promise { const url = new URL(`${this.#baseUrl}v2/${ name }:refreshAccessToken`); const body = JSON.stringify(req); const data = await request(url.href, { client: this.#client, method: "POST", body, }); return deserializeRefreshAccessTokenResponse(data); } } /** * AccessCredentials includes the OAuth access token, and the other fields * returned along with it. */ export interface AccessCredentials { /** * OAuth access token. */ accessToken?: string; /** * Duration till the access token expires. */ expiresIn?: number /* Duration */; /** * OAuth refresh token. */ refreshToken?: string; } function serializeAccessCredentials(data: any): AccessCredentials { return { ...data, expiresIn: data["expiresIn"] !== undefined ? data["expiresIn"] : undefined, }; } function deserializeAccessCredentials(data: any): AccessCredentials { return { ...data, expiresIn: data["expiresIn"] !== undefined ? data["expiresIn"] : undefined, }; } /** * Action message contains metadata information about a single action present * in the external system. */ export interface Action { /** * Brief Description of action */ description?: string; /** * Display Name of action to be shown on client side */ displayName?: string; /** * JsonSchema representation of this actions's input schema */ inputJsonSchema?: JsonSchema; /** * List containing input parameter metadata. */ inputParameters?: InputParameter[]; /** * Name of the action. */ name?: string; /** * JsonSchema representation of this actions's result schema */ resultJsonSchema?: JsonSchema; /** * List containing the metadata of result fields. */ resultMetadata?: ResultMetadata[]; } /** * AuthCodeData contains the data the runtime plane will give the connector * backend in exchange for access and refresh tokens. */ export interface AuthCodeData { /** * OAuth authorization code. */ authCode?: string; /** * OAuth PKCE verifier, needed if PKCE is enabled for this particular * connection. */ pkceVerifier?: string; /** * OAuth redirect URI passed in during the auth code flow, required by some * OAuth backends. */ redirectUri?: string; } /** * Response containing status of the connector for readiness prober. */ export interface CheckReadinessResponse { status?: string; } /** * The status of the connector. */ export interface CheckStatusResponse { /** * When the connector is not in ACTIVE state, the description must be * populated to specify the reason why it's not in ACTIVE state. */ description?: string; /** * State of the connector. */ state?: | "STATE_UNSPECIFIED" | "ACTIVE" | "ERROR" | "AUTH_ERROR"; } /** * Time window specified for daily operations. */ export interface DailyCycle { /** * Output only. Duration of the time window, set by service producer. */ duration?: number /* Duration */; /** * Time within the day to start the operations. */ startTime?: TimeOfDay; } function serializeDailyCycle(data: any): DailyCycle { return { ...data, duration: data["duration"] !== undefined ? data["duration"] : undefined, }; } function deserializeDailyCycle(data: any): DailyCycle { return { ...data, duration: data["duration"] !== undefined ? data["duration"] : 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; } /** * DenyMaintenancePeriod definition. Maintenance is forbidden within the deny * period. The start_date must be less than the end_date. */ export interface DenyMaintenancePeriod { /** * Deny period end date. This can be: * A full date, with non-zero year, * month and day values. * A month and day value, with a zero year. Allows * recurring deny periods each year. Date matching this period will have to be * before the end. */ endDate?: Date; /** * Deny period start date. This can be: * A full date, with non-zero year, * month and day values. * A month and day value, with a zero year. Allows * recurring deny periods each year. Date matching this period will have to be * the same or after the start. */ startDate?: Date; /** * Time in UTC when the Blackout period starts on start_date and ends on * end_date. This can be: * Full time. * All zeros for 00:00:00 UTC */ time?: TimeOfDay; } /** * A generic empty message that you can re-use to avoid defining duplicated * empty messages in your APIs. A typical example is to use it as the request or * the response type of an API method. For instance: service Foo { rpc * Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } */ export interface Empty { } /** * 'Entity row'/ 'Entity' refers to a single row of an entity type. */ export interface Entity { /** * Fields of the entity. The key is name of the field and the value contains * the applicable `google.protobuf.Value` entry for this field. */ fields?: { [key: string]: any }; /** * Output only. Resource name of the Entity. Format: * projects/{project}/locations/{location}/connections/{connection}/entityTypes/{type}/entities/{id} */ readonly name?: string; } /** * EntityType message contains metadata information about a single entity type * present in the external system. */ export interface EntityType { /** * List containing metadata information about each field of the entity type. */ fields?: Field[]; /** * JsonSchema representation of this entity's schema */ jsonSchema?: JsonSchema; /** * The name of the entity type. */ name?: string; operations?: | "OPERATION_UNSPECIFIED" | "LIST" | "GET" | "CREATE" | "UPDATE" | "DELETE"[]; } /** * ExchangeAuthCodeRequest currently includes the auth code data. */ export interface ExchangeAuthCodeRequest { /** * Optional. AuthCodeData contains the data the runtime requires to exchange * for access and refresh tokens. If the data is not provided, the runtime * will read the data from the secret manager. */ authCodeData?: AuthCodeData; } /** * ExchangeAuthCodeResponse includes the returned access token and its * associated credentials. */ export interface ExchangeAuthCodeResponse { accessCredentials?: AccessCredentials; } function serializeExchangeAuthCodeResponse(data: any): ExchangeAuthCodeResponse { return { ...data, accessCredentials: data["accessCredentials"] !== undefined ? serializeAccessCredentials(data["accessCredentials"]) : undefined, }; } function deserializeExchangeAuthCodeResponse(data: any): ExchangeAuthCodeResponse { return { ...data, accessCredentials: data["accessCredentials"] !== undefined ? deserializeAccessCredentials(data["accessCredentials"]) : undefined, }; } /** * Request message for ActionService.ExecuteAction */ export interface ExecuteActionRequest { /** * Parameters for executing the action. The parameters can be key/value pairs * or nested structs. */ parameters?: { [key: string]: any }; } /** * Response message for ActionService.ExecuteAction */ export interface ExecuteActionResponse { /** * In the case of successful invocation of the specified action, the results * Struct contains values based on the response of the action invoked. 1. If * the action execution produces any entities as a result, they are returned * as an array of Structs with the 'key' being the field name and the 'value' * being the value of that field in each result row. { 'results': [{'key': * 'value'}, ...] } */ results?: { [key: string]: any }[]; } /** * An execute sql query request containing the query and the connection to * execute it on. */ export interface ExecuteSqlQueryRequest { /** * Required. SQL statement passed by clients like Integration Platform, the * query is passed as-is to the driver used for interfacing with external * systems. */ query?: Query; } function serializeExecuteSqlQueryRequest(data: any): ExecuteSqlQueryRequest { return { ...data, query: data["query"] !== undefined ? serializeQuery(data["query"]) : undefined, }; } function deserializeExecuteSqlQueryRequest(data: any): ExecuteSqlQueryRequest { return { ...data, query: data["query"] !== undefined ? deserializeQuery(data["query"]) : undefined, }; } /** * A response returned by the connection after executing the sql query. */ export interface ExecuteSqlQueryResponse { /** * In the case of successful execution of the query the response contains * results returned by the external system. For example, the result rows of * the query are contained in the 'results' Struct list - "results": [ { * "field1": "val1", "field2": "val2",.. },.. ] Each Struct row can contain * fields any type of like nested Structs or lists. */ results?: { [key: string]: any }[]; } /** * Message contains EntityType's Field metadata. */ export interface Field { /** * The following map contains fields that are not explicitly mentioned * above,this give connectors the flexibility to add new metadata fields. */ additionalDetails?: { [key: string]: any }; /** * The data type of the Field. */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "INT" | "SMALLINT" | "DOUBLE" | "DATE" | "DATETIME" | "TIME" | "STRING" | "LONG" | "BOOLEAN" | "DECIMAL" | "UUID" | "BLOB" | "BIT" | "TINYINT" | "INTEGER" | "BIGINT" | "FLOAT" | "REAL" | "NUMERIC" | "CHAR" | "VARCHAR" | "LONGVARCHAR" | "TIMESTAMP" | "NCHAR" | "NVARCHAR" | "LONGNVARCHAR" | "NULL" | "OTHER" | "JAVA_OBJECT" | "DISTINCT" | "STRUCT" | "ARRAY" | "CLOB" | "REF" | "DATALINK" | "ROWID" | "BINARY" | "VARBINARY" | "LONGVARBINARY" | "NCLOB" | "SQLXML" | "REF_CURSOR" | "TIME_WITH_TIMEZONE" | "TIMESTAMP_WITH_TIMEZONE"; /** * The following field specifies the default value of the Field provided by * the external system if a value is not provided. */ defaultValue?: any; /** * A brief description of the Field. */ description?: string; /** * JsonSchema of the field, applicable only if field is of type `STRUCT` */ jsonSchema?: JsonSchema; /** * The following boolean field specifies if the current Field acts as a * primary key or id if the parent is of type entity. */ key?: boolean; /** * Name of the Field. */ name?: string; /** * Specifies whether a null value is allowed. */ nullable?: boolean; /** * Reference captures the association between two different entity types. * Value links to the reference of another entity type. */ reference?: Reference; } /** * Input Parameter message contains metadata about the parameters required for * executing an Action. */ export interface InputParameter { /** * The following map contains fields that are not explicitly mentioned * above,this give connectors the flexibility to add new metadata fields. */ additionalDetails?: { [key: string]: any }; /** * The data type of the Parameter */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "INT" | "SMALLINT" | "DOUBLE" | "DATE" | "DATETIME" | "TIME" | "STRING" | "LONG" | "BOOLEAN" | "DECIMAL" | "UUID" | "BLOB" | "BIT" | "TINYINT" | "INTEGER" | "BIGINT" | "FLOAT" | "REAL" | "NUMERIC" | "CHAR" | "VARCHAR" | "LONGVARCHAR" | "TIMESTAMP" | "NCHAR" | "NVARCHAR" | "LONGNVARCHAR" | "NULL" | "OTHER" | "JAVA_OBJECT" | "DISTINCT" | "STRUCT" | "ARRAY" | "CLOB" | "REF" | "DATALINK" | "ROWID" | "BINARY" | "VARBINARY" | "LONGVARBINARY" | "NCLOB" | "SQLXML" | "REF_CURSOR" | "TIME_WITH_TIMEZONE" | "TIMESTAMP_WITH_TIMEZONE"; /** * The following field specifies the default value of the Parameter provided * by the external system if a value is not provided. */ defaultValue?: any; /** * A brief description of the Parameter. */ description?: string; /** * JsonSchema of the parameter, applicable only if parameter is of type * `STRUCT` */ jsonSchema?: JsonSchema; /** * Name of the Parameter. */ name?: string; /** * Specifies whether a null value is allowed. */ nullable?: boolean; } /** * Instance represents the interface for SLM services to actuate the state of * control plane resources. Example Instance in JSON, where * consumer-project-number=123456, producer-project-id=cloud-sql: ```json * Instance: { "name": * "projects/123456/locations/us-east1/instances/prod-instance", "create_time": * { "seconds": 1526406431, }, "labels": { "env": "prod", "foo": "bar" }, * "state": READY, "software_versions": { "software_update": * "cloud-sql-09-28-2018", }, "maintenance_policy_names": { "UpdatePolicy": * "projects/123456/locations/us-east1/maintenancePolicies/prod-update-policy", * } "tenant_project_id": "cloud-sql-test-tenant", "producer_metadata": { * "cloud-sql-tier": "basic", "cloud-sql-instance-size": "1G", }, * "provisioned_resources": [ { "resource-type": "compute-instance", * "resource-url": * "https://www.googleapis.com/compute/v1/projects/cloud-sql/zones/us-east1-b/instances/vm-1", * } ], "maintenance_schedules": { "csa_rollout": { "start_time": { "seconds": * 1526406431, }, "end_time": { "seconds": 1535406431, }, }, "ncsa_rollout": { * "start_time": { "seconds": 1526406431, }, "end_time": { "seconds": * 1535406431, }, } }, "consumer_defined_name": "my-sql-instance1", } ``` * LINT.IfChange */ export interface Instance { /** * consumer_defined_name is the name of the instance set by the service * consumers. Generally this is different from the `name` field which * reperesents the system-assigned id of the instance which the service * consumers do not recognize. This is a required field for tenants onboarding * to Maintenance Window notifications * (go/slm-rollout-maintenance-policies#prerequisites). */ consumerDefinedName?: string; /** * Output only. Timestamp when the resource was created. */ readonly createTime?: Date; /** * Optional. The instance_type of this instance of format: * projects/{project_number}/locations/{location_id}/instanceTypes/{instance_type_id}. * Instance Type represents a high-level tier or SKU of the service that this * instance belong to. When enabled(eg: Maintenance Rollout), Rollout uses * 'instance_type' along with 'software_versions' to determine whether * instance needs an update or not. */ instanceType?: string; /** * Optional. Resource labels to represent user provided metadata. Each label * is a key-value pair, where both the key and the value are arbitrary strings * provided by the user. */ labels?: { [key: string]: string }; /** * Optional. The MaintenancePolicies that have been attached to the instance. * The key must be of the type name of the oneof policy name defined in * MaintenancePolicy, and the referenced policy must define the same policy * type. For details, please refer to go/mr-user-guide. Should not be set if * maintenance_settings.maintenance_policies is set. */ maintenancePolicyNames?: { [key: string]: string }; /** * The MaintenanceSchedule contains the scheduling information of published * maintenance schedule with same key as software_versions. */ maintenanceSchedules?: { [key: string]: MaintenanceSchedule }; /** * Optional. The MaintenanceSettings associated with instance. */ maintenanceSettings?: MaintenanceSettings; /** * Unique name of the resource. It uses the form: * `projects/{project_number}/locations/{location_id}/instances/{instance_id}` * Note: This name is passed, stored and logged across the rollout system. So * use of consumer project_id or any other consumer PII in the name is * strongly discouraged for wipeout (go/wipeout) compliance. See * go/elysium/project_ids#storage-guidance for more details. */ name?: string; /** * Optional. notification_parameter are information that service producers * may like to include that is not relevant to Rollout. This parameter will * only be passed to Gamma and Cloud Logging for notification/logging purpose. */ notificationParameters?: { [key: string]: NotificationParameter }; /** * Output only. Custom string attributes used primarily to expose * producer-specific information in monitoring dashboards. See * go/get-instance-metadata. */ readonly producerMetadata?: { [key: string]: string }; /** * Output only. The list of data plane resources provisioned for this * instance, e.g. compute VMs. See go/get-instance-metadata. */ readonly provisionedResources?: ProvisionedResource[]; /** * Link to the SLM instance template. Only populated when updating SLM * instances via SSA's Actuation service adaptor. Service producers with * custom control plane (e.g. Cloud SQL) doesn't need to populate this field. * Instead they should use software_versions. */ slmInstanceTemplate?: string; /** * Output only. SLO metadata for instance classification in the Standardized * dataplane SLO platform. See go/cloud-ssa-standard-slo for feature * description. */ readonly sloMetadata?: SloMetadata; /** * Software versions that are used to deploy this instance. This can be * mutated by rollout services. */ softwareVersions?: { [key: string]: string }; /** * Output only. Current lifecycle state of the resource (e.g. if it's being * created or ready to use). */ readonly state?: | "STATE_UNSPECIFIED" | "CREATING" | "READY" | "UPDATING" | "REPAIRING" | "DELETING" | "ERROR"; /** * Output only. ID of the associated GCP tenant project. See * go/get-instance-metadata. */ readonly tenantProjectId?: string; /** * Output only. Timestamp when the resource was last modified. */ readonly updateTime?: Date; } function serializeInstance(data: any): Instance { return { ...data, maintenanceSchedules: data["maintenanceSchedules"] !== undefined ? Object.fromEntries(Object.entries(data["maintenanceSchedules"]).map(([k, v]: [string, any]) => ([k, serializeMaintenanceSchedule(v)]))) : undefined, maintenanceSettings: data["maintenanceSettings"] !== undefined ? serializeMaintenanceSettings(data["maintenanceSettings"]) : undefined, }; } function deserializeInstance(data: any): Instance { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, maintenanceSchedules: data["maintenanceSchedules"] !== undefined ? Object.fromEntries(Object.entries(data["maintenanceSchedules"]).map(([k, v]: [string, any]) => ([k, deserializeMaintenanceSchedule(v)]))) : undefined, maintenanceSettings: data["maintenanceSettings"] !== undefined ? deserializeMaintenanceSettings(data["maintenanceSettings"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * JsonSchema representation of schema metadata */ export interface JsonSchema { /** * Additional details apart from standard json schema fields, this gives * flexibility to store metadata about the schema */ additionalDetails?: { [key: string]: any }; /** * The default value of the field or object described by this schema. */ default?: any; /** * A description of this schema. */ description?: string; /** * Possible values for an enumeration. This works in conjunction with `type` * to represent types with a fixed set of legal values */ enum?: any[]; /** * Format of the value as per * https://json-schema.org/understanding-json-schema/reference/string.html#format */ format?: string; /** * Schema that applies to array values, applicable only if this is of type * `array`. */ items?: JsonSchema; /** * JDBC datatype of the field. */ jdbcType?: | "DATA_TYPE_UNSPECIFIED" | "INT" | "SMALLINT" | "DOUBLE" | "DATE" | "DATETIME" | "TIME" | "STRING" | "LONG" | "BOOLEAN" | "DECIMAL" | "UUID" | "BLOB" | "BIT" | "TINYINT" | "INTEGER" | "BIGINT" | "FLOAT" | "REAL" | "NUMERIC" | "CHAR" | "VARCHAR" | "LONGVARCHAR" | "TIMESTAMP" | "NCHAR" | "NVARCHAR" | "LONGNVARCHAR" | "NULL" | "OTHER" | "JAVA_OBJECT" | "DISTINCT" | "STRUCT" | "ARRAY" | "CLOB" | "REF" | "DATALINK" | "ROWID" | "BINARY" | "VARBINARY" | "LONGVARBINARY" | "NCLOB" | "SQLXML" | "REF_CURSOR" | "TIME_WITH_TIMEZONE" | "TIMESTAMP_WITH_TIMEZONE"; /** * The child schemas, applicable only if this is of type `object`. The key is * the name of the property and the value is the json schema that describes * that property */ properties?: { [key: string]: JsonSchema }; /** * Whether this property is required. */ required?: string[]; /** * JSON Schema Validation: A Vocabulary for Structural Validation of JSON */ type?: string[]; } /** * Response message for ActionService.ListActions */ export interface ListActionsResponse { /** * List of action metadata. */ actions?: Action[]; /** * Next page token if more actions available. */ nextPageToken?: string; /** * List of actions which contain unsupported Datatypes. Check datatype.proto * for more information. */ unsupportedActionNames?: string[]; } /** * Response message for EntityService.ListEntities */ export interface ListEntitiesResponse { /** * List containing entity rows. */ entities?: Entity[]; /** * Next page token if more records are available. */ nextPageToken?: string; } /** * Response message for EntityService.ListEntityTypes */ export interface ListEntityTypesResponse { /** * Next page token if more entity types available. */ nextPageToken?: string; /** * List of metadata related to all entity types. */ types?: EntityType[]; /** * List of entity type names which contain unsupported Datatypes. Check * datatype.proto for more information. */ unsupportedTypeNames?: string[]; } /** * Defines policies to service maintenance events. */ export interface MaintenancePolicy { /** * Output only. The time when the resource was created. */ createTime?: Date; /** * Optional. Description of what this policy is for. Create/Update methods * return INVALID_ARGUMENT if the length is greater than 512. */ description?: string; /** * Optional. Resource labels to represent user provided metadata. Each label * is a key-value pair, where both the key and the value are arbitrary strings * provided by the user. */ labels?: { [key: string]: string }; /** * Required. MaintenancePolicy name using the form: * `projects/{project_id}/locations/{location_id}/maintenancePolicies/{maintenance_policy_id}` * where {project_id} refers to a GCP consumer project ID, {location_id} * refers to a GCP region/zone, {maintenance_policy_id} must be 1-63 * characters long and match the regular expression * `[a-z0-9]([-a-z0-9]*[a-z0-9])?`. */ name?: string; /** * Optional. The state of the policy. */ state?: | "STATE_UNSPECIFIED" | "READY" | "DELETING"; /** * Maintenance policy applicable to instance update. */ updatePolicy?: UpdatePolicy; /** * Output only. The time when the resource was updated. */ updateTime?: Date; } function serializeMaintenancePolicy(data: any): MaintenancePolicy { return { ...data, createTime: data["createTime"] !== undefined ? data["createTime"].toISOString() : undefined, updatePolicy: data["updatePolicy"] !== undefined ? serializeUpdatePolicy(data["updatePolicy"]) : undefined, updateTime: data["updateTime"] !== undefined ? data["updateTime"].toISOString() : undefined, }; } function deserializeMaintenancePolicy(data: any): MaintenancePolicy { return { ...data, createTime: data["createTime"] !== undefined ? new Date(data["createTime"]) : undefined, updatePolicy: data["updatePolicy"] !== undefined ? deserializeUpdatePolicy(data["updatePolicy"]) : undefined, updateTime: data["updateTime"] !== undefined ? new Date(data["updateTime"]) : undefined, }; } /** * Maintenance schedule which is exposed to customer and potentially end user, * indicating published upcoming future maintenance schedule */ export interface MaintenanceSchedule { /** * This field is deprecated, and will be always set to true since reschedule * can happen multiple times now. This field should not be removed until all * service producers remove this for their customers. */ canReschedule?: boolean; /** * The scheduled end time for the maintenance. */ endTime?: Date; /** * The rollout management policy this maintenance schedule is associated * with. When doing reschedule update request, the reschedule should be * against this given policy. */ rolloutManagementPolicy?: string; /** * schedule_deadline_time is the time deadline any schedule start time cannot * go beyond, including reschedule. It's normally the initial schedule start * time plus maintenance window length (1 day or 1 week). Maintenance cannot * be scheduled to start beyond this deadline. */ scheduleDeadlineTime?: Date; /** * The scheduled start time for the maintenance. */ startTime?: Date; } function serializeMaintenanceSchedule(data: any): MaintenanceSchedule { return { ...data, endTime: data["endTime"] !== undefined ? data["endTime"].toISOString() : undefined, scheduleDeadlineTime: data["scheduleDeadlineTime"] !== undefined ? data["scheduleDeadlineTime"].toISOString() : undefined, startTime: data["startTime"] !== undefined ? data["startTime"].toISOString() : undefined, }; } function deserializeMaintenanceSchedule(data: any): MaintenanceSchedule { return { ...data, endTime: data["endTime"] !== undefined ? new Date(data["endTime"]) : undefined, scheduleDeadlineTime: data["scheduleDeadlineTime"] !== undefined ? new Date(data["scheduleDeadlineTime"]) : undefined, startTime: data["startTime"] !== undefined ? new Date(data["startTime"]) : undefined, }; } /** * Maintenance settings associated with instance. Allows service producers and * end users to assign settings that controls maintenance on this instance. */ export interface MaintenanceSettings { /** * Optional. Exclude instance from maintenance. When true, rollout service * will not attempt maintenance on the instance. Rollout service will include * the instance in reported rollout progress as not attempted. */ exclude?: boolean; /** * Optional. If the update call is triggered from rollback, set the value as * true. */ isRollback?: boolean; /** * Optional. The MaintenancePolicies that have been attached to the instance. * The key must be of the type name of the oneof policy name defined in * MaintenancePolicy, and the embedded policy must define the same policy * type. For details, please refer to go/mr-user-guide. Should not be set if * maintenance_policy_names is set. If only the name is needed, then only * populate MaintenancePolicy.name. */ maintenancePolicies?: { [key: string]: MaintenancePolicy }; } function serializeMaintenanceSettings(data: any): MaintenanceSettings { return { ...data, maintenancePolicies: data["maintenancePolicies"] !== undefined ? Object.fromEntries(Object.entries(data["maintenancePolicies"]).map(([k, v]: [string, any]) => ([k, serializeMaintenancePolicy(v)]))) : undefined, }; } function deserializeMaintenanceSettings(data: any): MaintenanceSettings { return { ...data, maintenancePolicies: data["maintenancePolicies"] !== undefined ? Object.fromEntries(Object.entries(data["maintenancePolicies"]).map(([k, v]: [string, any]) => ([k, deserializeMaintenancePolicy(v)]))) : undefined, }; } /** * MaintenanceWindow definition. */ export interface MaintenanceWindow { /** * Daily cycle. */ dailyCycle?: DailyCycle; /** * Weekly cycle. */ weeklyCycle?: WeeklyCycle; } function serializeMaintenanceWindow(data: any): MaintenanceWindow { return { ...data, dailyCycle: data["dailyCycle"] !== undefined ? serializeDailyCycle(data["dailyCycle"]) : undefined, weeklyCycle: data["weeklyCycle"] !== undefined ? serializeWeeklyCycle(data["weeklyCycle"]) : undefined, }; } function deserializeMaintenanceWindow(data: any): MaintenanceWindow { return { ...data, dailyCycle: data["dailyCycle"] !== undefined ? deserializeDailyCycle(data["dailyCycle"]) : undefined, weeklyCycle: data["weeklyCycle"] !== undefined ? deserializeWeeklyCycle(data["weeklyCycle"]) : undefined, }; } /** * Node information for custom per-node SLO implementations. SSA does not * support per-node SLO, but producers can populate per-node information in * SloMetadata for custom precomputations. SSA Eligibility Exporter will emit * per-node metric based on this information. */ export interface NodeSloMetadata { /** * The location of the node, if different from instance location. */ location?: string; /** * The id of the node. This should be equal to SaasInstanceNode.node_id. */ nodeId?: string; /** * If present, this will override eligibility for the node coming from * instance or exclusions for specified SLIs. */ perSliEligibility?: PerSliSloEligibility; } /** * Contains notification related data. */ export interface NotificationParameter { /** * Optional. Array of string values. e.g. instance's replica information. */ values?: string[]; } /** * PerSliSloEligibility is a mapping from an SLI name to eligibility. */ export interface PerSliSloEligibility { /** * An entry in the eligibilities map specifies an eligibility for a * particular SLI for the given instance. The SLI key in the name must be a * valid SLI name specified in the Eligibility Exporter binary flags otherwise * an error will be emitted by Eligibility Exporter and the oncaller will be * alerted. If an SLI has been defined in the binary flags but the * eligibilities map does not contain it, the corresponding SLI time series * will not be emitted by the Eligibility Exporter. This ensures a smooth * rollout and compatibility between the data produced by different versions * of the Eligibility Exporters. If eligibilities map contains a key for an * SLI which has not been declared in the binary flags, there will be an error * message emitted in the Eligibility Exporter log and the metric for the SLI * in question will not be emitted. */ eligibilities?: { [key: string]: SloEligibility }; } /** * Additional options for Connectors#projectsLocationsConnectionsActionsList. */ export interface ProjectsLocationsConnectionsActionsListOptions { /** * Number of Actions to return. Defaults to 25. */ pageSize?: number; /** * Page token, return from a previous ListActions call, that can be used * retrieve the next page of content. If unspecified, the request returns the * first page of actions. */ pageToken?: string; /** * Specifies which fields of the Action are returned in the response. */ view?: | "ACTION_VIEW_UNSPECIFIED" | "ACTION_VIEW_BASIC" | "ACTION_VIEW_FULL"; } /** * Additional options for * Connectors#projectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditions. */ export interface ProjectsLocationsConnectionsEntityTypesEntitiesDeleteEntitiesWithConditionsOptions { /** * Required. Conditions to be used when deleting entities. From a proto * standpoint, There are no restrictions on what can be passed using this * field. The connector documentation should have information about what * format of filters/conditions are supported. Note: If this conditions field * is left empty, an exception is thrown. We don't want to consider 'empty * conditions' to be a match-all case. Connector developers can determine and * document what a match-all case constraint would be. */ conditions?: string; } /** * Additional options for * Connectors#projectsLocationsConnectionsEntityTypesEntitiesList. */ export interface ProjectsLocationsConnectionsEntityTypesEntitiesListOptions { /** * Conditions to be used when listing entities. From a proto standpoint, * There are no restrictions on what can be passed using this field. The * connector documentation should have information about what format of * filters/conditions are supported. */ conditions?: string; /** * Number of entity rows to return. Defaults page size = 25. Max page size = * 200. */ pageSize?: number; /** * Page token value if available from a previous request. */ pageToken?: string; /** * List of 'sort_by' columns to use when returning the results. */ sortBy?: string; } /** * Additional options for * Connectors#projectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditions. */ export interface ProjectsLocationsConnectionsEntityTypesEntitiesUpdateEntitiesWithConditionsOptions { /** * Required. Conditions to be used when updating entities. From a proto * standpoint, There are no restrictions on what can be passed using this * field. The connector documentation should have information about what * format of filters/conditions are supported. Note: If this conditions field * is left empty, an exception is thrown. We don't want to consider 'empty * conditions' to be a match-all case. Connector developers can determine and * document what a match-all case constraint would be. */ conditions?: string; } /** * Additional options for * Connectors#projectsLocationsConnectionsEntityTypesList. */ export interface ProjectsLocationsConnectionsEntityTypesListOptions { /** * Number of entity types to return. Defaults to 25. */ pageSize?: number; /** * Page token, return from a previous ListEntityTypes call, that can be used * retrieve the next page of content. If unspecified, the request returns the * first page of entity types. */ pageToken?: string; /** * Specifies which fields of the Entity Type are returned in the response. */ view?: | "ENTITY_TYPE_VIEW_UNSPECIFIED" | "ENTITY_TYPE_VIEW_BASIC" | "ENTITY_TYPE_VIEW_FULL"; } /** * Describes provisioned dataplane resources. */ export interface ProvisionedResource { /** * Type of the resource. This can be either a GCP resource or a custom one * (e.g. another cloud provider's VM). For GCP compute resources use singular * form of the names listed in GCP compute API documentation * (https://cloud.google.com/compute/docs/reference/rest/v1/), prefixed with * 'compute-', for example: 'compute-instance', 'compute-disk', * 'compute-autoscaler'. */ resourceType?: string; /** * URL identifying the resource, e.g. * "https://www.googleapis.com/compute/v1/projects/...)". */ resourceUrl?: string; } /** * A wrapper around the SQL query statement. This is needed so that the JSON * representation of ExecuteSqlQueryRequest has the following format: * `{"query":"select *"}`. */ export interface Query { /** * Sets the limit for the maximum number of rows returned after the query * execution. */ maxRows?: bigint; /** * Required. Sql query to execute. */ query?: string; /** * In the struct, the value corresponds to the value of query parameter and * date type corresponds to the date type of the query parameter. */ queryParameters?: QueryParameter[]; /** * Sets the number of seconds the driver will wait for a query to execute. */ timeout?: bigint; } function serializeQuery(data: any): Query { return { ...data, maxRows: data["maxRows"] !== undefined ? String(data["maxRows"]) : undefined, timeout: data["timeout"] !== undefined ? String(data["timeout"]) : undefined, }; } function deserializeQuery(data: any): Query { return { ...data, maxRows: data["maxRows"] !== undefined ? BigInt(data["maxRows"]) : undefined, timeout: data["timeout"] !== undefined ? BigInt(data["timeout"]) : undefined, }; } /** * Query parameter definition */ export interface QueryParameter { dataType?: | "DATA_TYPE_UNSPECIFIED" | "INT" | "SMALLINT" | "DOUBLE" | "DATE" | "DATETIME" | "TIME" | "STRING" | "LONG" | "BOOLEAN" | "DECIMAL" | "UUID" | "BLOB" | "BIT" | "TINYINT" | "INTEGER" | "BIGINT" | "FLOAT" | "REAL" | "NUMERIC" | "CHAR" | "VARCHAR" | "LONGVARCHAR" | "TIMESTAMP" | "NCHAR" | "NVARCHAR" | "LONGNVARCHAR" | "NULL" | "OTHER" | "JAVA_OBJECT" | "DISTINCT" | "STRUCT" | "ARRAY" | "CLOB" | "REF" | "DATALINK" | "ROWID" | "BINARY" | "VARBINARY" | "LONGVARBINARY" | "NCLOB" | "SQLXML" | "REF_CURSOR" | "TIME_WITH_TIMEZONE" | "TIMESTAMP_WITH_TIMEZONE"; value?: any; } export interface Reference { /** * Name of the reference field. */ name?: string; /** * Name of reference entity type. */ type?: string; } /** * RefreshAccessTokenRequest includes the refresh token. */ export interface RefreshAccessTokenRequest { /** * Optional. Refresh Token String. If the Refresh Token is not provided, the * runtime will read the data from the secret manager. */ refreshToken?: string; } /** * RefreshAccessTokenResponse includes the returned access token and its * associated credentials. */ export interface RefreshAccessTokenResponse { accessCredentials?: AccessCredentials; } function serializeRefreshAccessTokenResponse(data: any): RefreshAccessTokenResponse { return { ...data, accessCredentials: data["accessCredentials"] !== undefined ? serializeAccessCredentials(data["accessCredentials"]) : undefined, }; } function deserializeRefreshAccessTokenResponse(data: any): RefreshAccessTokenResponse { return { ...data, accessCredentials: data["accessCredentials"] !== undefined ? deserializeAccessCredentials(data["accessCredentials"]) : undefined, }; } /** * Result Metadata message contains metadata about the result returned after * executing an Action. */ export interface ResultMetadata { /** * The data type of the metadata field */ dataType?: | "DATA_TYPE_UNSPECIFIED" | "INT" | "SMALLINT" | "DOUBLE" | "DATE" | "DATETIME" | "TIME" | "STRING" | "LONG" | "BOOLEAN" | "DECIMAL" | "UUID" | "BLOB" | "BIT" | "TINYINT" | "INTEGER" | "BIGINT" | "FLOAT" | "REAL" | "NUMERIC" | "CHAR" | "VARCHAR" | "LONGVARCHAR" | "TIMESTAMP" | "NCHAR" | "NVARCHAR" | "LONGNVARCHAR" | "NULL" | "OTHER" | "JAVA_OBJECT" | "DISTINCT" | "STRUCT" | "ARRAY" | "CLOB" | "REF" | "DATALINK" | "ROWID" | "BINARY" | "VARBINARY" | "LONGVARBINARY" | "NCLOB" | "SQLXML" | "REF_CURSOR" | "TIME_WITH_TIMEZONE" | "TIMESTAMP_WITH_TIMEZONE"; /** * The following field specifies the default value of the Parameter provided * by the external system if a value is not provided. */ defaultValue?: any; /** * A brief description of the metadata field. */ description?: string; /** * JsonSchema of the result, applicable only if parameter is of type `STRUCT` */ jsonSchema?: JsonSchema; /** * Name of the metadata field. */ name?: string; /** * Specifies whether a null value is allowed. */ nullable?: boolean; } /** * Configure the schedule. */ export interface Schedule { /** * Allows to define schedule that runs specified day of the week. */ day?: | "DAY_OF_WEEK_UNSPECIFIED" | "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY"; /** * Output only. Duration of the time window, set by service producer. */ duration?: number /* Duration */; /** * Time within the window to start the operations. */ startTime?: TimeOfDay; } function serializeSchedule(data: any): Schedule { return { ...data, duration: data["duration"] !== undefined ? data["duration"] : undefined, }; } function deserializeSchedule(data: any): Schedule { return { ...data, duration: data["duration"] !== undefined ? data["duration"] : undefined, }; } /** * SloEligibility is a tuple containing eligibility value: true if an instance * is eligible for SLO calculation or false if it should be excluded from all * SLO-related calculations along with a user-defined reason. */ export interface SloEligibility { /** * Whether an instance is eligible or ineligible. */ eligible?: boolean; /** * User-defined reason for the current value of instance eligibility. * Usually, this can be directly mapped to the internal state. An empty reason * is allowed. */ reason?: string; } /** * SloMetadata contains resources required for proper SLO classification of the * instance. */ export interface SloMetadata { /** * Optional. List of nodes. Some producers need to use per-node metadata to * calculate SLO. This field allows such producers to publish per-node SLO * meta data, which will be consumed by SSA Eligibility Exporter and published * in the form of per node metric to Monarch. */ nodes?: NodeSloMetadata[]; /** * Optional. Multiple per-instance SLI eligibilities which apply for * individual SLIs. */ perSliEligibility?: PerSliSloEligibility; /** * Name of the SLO tier the Instance belongs to. This name will be expected * to match the tiers specified in the service SLO configuration. Field is * mandatory and must not be empty. */ tier?: 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; } /** * Response message for EntityService.UpdateEntitiesWithConditions */ export interface UpdateEntitiesWithConditionsResponse { /** * Response returned by the external system. */ response?: { [key: string]: any }; } /** * Maintenance policy applicable to instance updates. */ export interface UpdatePolicy { /** * Optional. Relative scheduling channel applied to resource. */ channel?: | "UPDATE_CHANNEL_UNSPECIFIED" | "EARLIER" | "LATER" | "WEEK1" | "WEEK2" | "WEEK5"; /** * Deny Maintenance Period that is applied to resource to indicate when * maintenance is forbidden. The protocol supports zero-to-many such periods, * but the current SLM Rollout implementation only supports zero-to-one. */ denyMaintenancePeriods?: DenyMaintenancePeriod[]; /** * Optional. Maintenance window that is applied to resources covered by this * policy. */ window?: MaintenanceWindow; } function serializeUpdatePolicy(data: any): UpdatePolicy { return { ...data, window: data["window"] !== undefined ? serializeMaintenanceWindow(data["window"]) : undefined, }; } function deserializeUpdatePolicy(data: any): UpdatePolicy { return { ...data, window: data["window"] !== undefined ? deserializeMaintenanceWindow(data["window"]) : undefined, }; } /** * Time window specified for weekly operations. */ export interface WeeklyCycle { /** * User can specify multiple windows in a week. Minimum of 1 window. */ schedule?: Schedule[]; } function serializeWeeklyCycle(data: any): WeeklyCycle { return { ...data, schedule: data["schedule"] !== undefined ? data["schedule"].map((item: any) => (serializeSchedule(item))) : undefined, }; } function deserializeWeeklyCycle(data: any): WeeklyCycle { return { ...data, schedule: data["schedule"] !== undefined ? data["schedule"].map((item: any) => (deserializeSchedule(item))) : undefined, }; }