From d54cfbec4a8d175c28bc145b9eda5a8eab5c05ca Mon Sep 17 00:00:00 2001 From: Grant Timmerman <744973+grant@users.noreply.github.com> Date: Wed, 20 Jan 2021 13:49:47 -0600 Subject: [PATCH] feat!: run the generator 2020/12 (#83) Signed-off-by: Grant Timmerman --- cloud/audit/v1/LogEntryData.ts | 38 ++++++++++++------- cloud/cloudbuild/v1/BuildEventData.ts | 32 ++++++++-------- cloud/firestore/v1/DocumentEventData.ts | 16 +++++--- cloud/storage/v1/StorageObjectData.ts | 6 +-- firebase/analytics/v1/AnalyticsLogData.ts | 14 +++---- firebase/auth/v1/AuthEventData.ts | 2 +- firebase/database/v1/ReferenceEventData.ts | 10 ++++- .../remoteconfig/v1/RemoteConfigEventData.ts | 22 +++++++++-- 8 files changed, 88 insertions(+), 52 deletions(-) diff --git a/cloud/audit/v1/LogEntryData.ts b/cloud/audit/v1/LogEntryData.ts index 99a180b..b536aa2 100644 --- a/cloud/audit/v1/LogEntryData.ts +++ b/cloud/audit/v1/LogEntryData.ts @@ -54,7 +54,7 @@ export interface LogEntryData { /** * The severity of the log entry. */ - severity?: number | string; + severity?: InsertID | number; /** * The span ID within the trace associated with the log entry, if any. * @@ -133,7 +133,7 @@ export interface ProtoPayload { * The number of items returned from a List or Query API method, * if applicable. */ - numResponseItems?: string; + numResponseItems?: number; /** * The operation request. This may not include all request parameters, * such as those that are too large, privacy-sensitive, or duplicated @@ -279,7 +279,7 @@ export interface ServiceMetadata { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -299,7 +299,7 @@ export interface ThirdPartyClaims { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -312,7 +312,7 @@ export interface AuthenticationInfoThirdPartyPrincipal { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -397,7 +397,7 @@ export interface Metadata { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -412,7 +412,7 @@ export interface Request { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -495,7 +495,7 @@ export interface DestinationAttributes { /** * The network port of the peer. */ - port?: string; + port?: number; /** * The identity of this peer. Similar to `Request.auth.principal`, but * relative to the peer instead of the request. For example, the @@ -575,7 +575,7 @@ export interface RequestAttributes { /** * The HTTP request size in bytes. If unknown, it must be -1. */ - size?: string; + size?: number; /** * The timestamp when the `destination` service receives the first byte of * the request. @@ -671,7 +671,7 @@ export interface Claims { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -715,7 +715,7 @@ export interface ResourceOriginalState { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -730,7 +730,7 @@ export interface Response { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -744,7 +744,7 @@ export interface ServiceData { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** @@ -907,6 +907,18 @@ export interface Resource { type?: string; } +export enum InsertID { + Alert = "ALERT", + Critical = "CRITICAL", + Debug = "DEBUG", + Default = "DEFAULT", + Emergency = "EMERGENCY", + Error = "ERROR", + Info = "INFO", + Notice = "NOTICE", + Warning = "WARNING", +} + /** * Cast a raw JSON object to a typed event (useful for IDE autocompletion). * @param {object} json The JSON object diff --git a/cloud/cloudbuild/v1/BuildEventData.ts b/cloud/cloudbuild/v1/BuildEventData.ts index 40524b0..8c2b4b6 100644 --- a/cloud/cloudbuild/v1/BuildEventData.ts +++ b/cloud/cloudbuild/v1/BuildEventData.ts @@ -237,7 +237,7 @@ export interface Options { * requested. At present, the maximum disk size is 1000GB; builds that request * more than the maximum are rejected with an error. */ - diskSizeGb?: string; + diskSizeGb?: number; /** * A list of global environment variable definitions that will exist for all * build steps in this build. If a variable is defined in both globally and in @@ -275,7 +275,7 @@ export interface Options { /** * Requested hash for SourceProvenance. */ - sourceProvenanceHash?: Array; + sourceProvenanceHash?: Array; /** * Option to specify behavior when there is an error in the substitution * checks. @@ -323,6 +323,12 @@ export enum RequestedVerifyOptionEnum { Verified = "VERIFIED", } +export enum SourceProvenanceHashEnum { + Md5 = "MD5", + None = "NONE", + Sha256 = "SHA256", +} + export enum SubstitutionOptionEnum { AllowLoose = "ALLOW_LOOSE", MustMatch = "MUST_MATCH", @@ -371,7 +377,7 @@ export interface QueueTTL { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds?: string; + seconds?: number; } /** @@ -407,7 +413,7 @@ export interface Results { /** * Number of artifacts uploaded. Only populated when artifacts are uploaded. */ - numArtifacts?: string; + numArtifacts?: number; } /** @@ -568,7 +574,7 @@ export interface StorageSourceObject { * Google Cloud Storage generation for the object. If the generation is * omitted, the latest generation will be used. */ - generation?: string; + generation?: number; /** * Google Cloud Storage object containing the source. */ @@ -618,19 +624,13 @@ export interface FileHashElement { /** * The type of hash that was performed. */ - type?: TypeEnum | number; + type?: SourceProvenanceHashEnum | number; /** * The hash value. */ value?: string; } -export enum TypeEnum { - Md5 = "MD5", - None = "NONE", - Sha256 = "SHA256", -} - /** * A copy of the build's `source.repo_source`, if exists, with any * revisions resolved. @@ -705,7 +705,7 @@ export interface ResolvedStorageSourceObject { * Google Cloud Storage generation for the object. If the generation is * omitted, the latest generation will be used. */ - generation?: string; + generation?: number; /** * Google Cloud Storage object containing the source. */ @@ -804,7 +804,7 @@ export interface Step { * only updated on build completion; step status is not updated in real-time * as the build progresses. */ - status?: number | string; + status?: StatusEnum | number; /** * Time limit for executing this build step. If not defined, the step has no * time limit and will be allowed to continue to run until either it completes @@ -875,7 +875,7 @@ export interface StepTimeout { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds?: string; + seconds?: number; } /** @@ -916,7 +916,7 @@ export interface BuildEventDataTimeout { * to +315,576,000,000 inclusive. Note: these bounds are computed from: * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years */ - seconds?: string; + seconds?: number; } /** diff --git a/cloud/firestore/v1/DocumentEventData.ts b/cloud/firestore/v1/DocumentEventData.ts index bafbdb1..e19a55d 100644 --- a/cloud/firestore/v1/DocumentEventData.ts +++ b/cloud/firestore/v1/DocumentEventData.ts @@ -125,7 +125,7 @@ export interface OldValueField { /** * An integer value. */ - integerValue?: string; + integerValue?: number; /** * A map value. */ @@ -133,7 +133,7 @@ export interface OldValueField { /** * A null value. */ - nullValue?: number | string; + nullValue?: BytesValue | number; /** * A reference to a document. For example: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. @@ -189,7 +189,7 @@ export interface MapValueField { /** * An integer value. */ - integerValue?: string; + integerValue?: number; /** * A map value. */ @@ -197,7 +197,7 @@ export interface MapValueField { /** * A null value. */ - nullValue?: number | string; + nullValue?: BytesValue | number; /** * A reference to a document. For example: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. @@ -268,7 +268,7 @@ export interface ValueElement { /** * An integer value. */ - integerValue?: string; + integerValue?: number; /** * A map value. */ @@ -276,7 +276,7 @@ export interface ValueElement { /** * A null value. */ - nullValue?: number | string; + nullValue?: BytesValue | number; /** * A reference to a document. For example: * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. @@ -326,6 +326,10 @@ export interface GeoPointValue { longitude?: number; } +export enum BytesValue { + NullValue = "NULL_VALUE", +} + /** * A DocumentMask object that lists changed fields. * This is only populated for update events. diff --git a/cloud/storage/v1/StorageObjectData.ts b/cloud/storage/v1/StorageObjectData.ts index b02e2bb..ad473c9 100644 --- a/cloud/storage/v1/StorageObjectData.ts +++ b/cloud/storage/v1/StorageObjectData.ts @@ -80,7 +80,7 @@ export interface StorageObjectData { * The content generation of this object. Used for object versioning. * Attempting to set this field will result in an error. */ - generation?: string; + generation?: number; /** * The ID of the object, including the bucket name, object name, and * generation number. @@ -117,7 +117,7 @@ export interface StorageObjectData { * number is only meaningful in the context of a particular generation of a * particular object. */ - metageneration?: string; + metageneration?: number; /** * The name of the object. */ @@ -135,7 +135,7 @@ export interface StorageObjectData { * Content-Length of the object data in bytes, matching * [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 ยง3.3.2]. */ - size?: string; + size?: number; /** * Storage class of the object. */ diff --git a/firebase/analytics/v1/AnalyticsLogData.ts b/firebase/analytics/v1/AnalyticsLogData.ts index 84721ae..98d7bbd 100644 --- a/firebase/analytics/v1/AnalyticsLogData.ts +++ b/firebase/analytics/v1/AnalyticsLogData.ts @@ -48,11 +48,11 @@ export interface EventDim { /** * UTC client time when the previous event happened. */ - previousTimestampMicros?: string; + previousTimestampMicros?: number; /** * UTC client time when the event happened. */ - timestampMicros?: string; + timestampMicros?: number; /** * Value param in USD. */ @@ -66,7 +66,7 @@ export interface EventDim { export interface AnalyticsValue { doubleValue?: number; floatValue?: number; - intValue?: string; + intValue?: number; stringValue?: string; } @@ -89,7 +89,7 @@ export interface UserDim { /** * The time (in microseconds) at which the user first opened the app. */ - firstOpenTimestampMicros?: string; + firstOpenTimestampMicros?: number; /** * User's geographic information. */ @@ -155,7 +155,7 @@ export interface BundleInfo { /** * Timestamp offset between collection time and upload time. */ - serverTimestampOffsetMicros?: string; + serverTimestampOffsetMicros?: number; } /** @@ -288,7 +288,7 @@ export interface UserProperty { /** * UTC client time when user property was last set. */ - setTimestampUsec?: string; + setTimestampUsec?: number; /** * Last set value of user property. */ @@ -304,7 +304,7 @@ export interface UserProperty { export interface Value { doubleValue?: number; floatValue?: number; - intValue?: string; + intValue?: number; stringValue?: string; } diff --git a/firebase/auth/v1/AuthEventData.ts b/firebase/auth/v1/AuthEventData.ts index 3b5f695..c0cd6d1 100644 --- a/firebase/auth/v1/AuthEventData.ts +++ b/firebase/auth/v1/AuthEventData.ts @@ -69,7 +69,7 @@ export interface CustomClaims { /** * Unordered map of dynamically typed values. */ - fields?: { [key: string]: { [key: string]: any } | null }; + fields?: { [key: string]: { [key: string]: any } }; } /** diff --git a/firebase/database/v1/ReferenceEventData.ts b/firebase/database/v1/ReferenceEventData.ts index 883a838..33777ed 100644 --- a/firebase/database/v1/ReferenceEventData.ts +++ b/firebase/database/v1/ReferenceEventData.ts @@ -18,8 +18,14 @@ * The data within all Firebase Real Time Database reference events. */ export interface ReferenceEventData { - data?: { [key: string]: any } | null; - delta?: { [key: string]: any } | null; + /** + * The original data for the reference. + */ + data?: { [key: string]: any }; + /** + * The change in the reference data. + */ + delta?: { [key: string]: any }; } /** diff --git a/firebase/remoteconfig/v1/RemoteConfigEventData.ts b/firebase/remoteconfig/v1/RemoteConfigEventData.ts index 90c1614..500b175 100644 --- a/firebase/remoteconfig/v1/RemoteConfigEventData.ts +++ b/firebase/remoteconfig/v1/RemoteConfigEventData.ts @@ -26,11 +26,11 @@ export interface RemoteConfigEventData { * Only present if this version is the result of a rollback, and will be the * version number of the Remote Config template that was rolled-back to. */ - rollbackSource?: string; + rollbackSource?: number; /** * Where the update action originated. */ - updateOrigin?: number | string; + updateOrigin?: UpdateOriginEnum | number; /** * When the Remote Config template was written to the Remote Config server. */ @@ -38,7 +38,7 @@ export interface RemoteConfigEventData { /** * What type of update was made. */ - updateType?: number | string; + updateType?: UpdateTypeEnum | number; /** * Aggregation of all metadata fields about the account that performed the update. */ @@ -46,7 +46,21 @@ export interface RemoteConfigEventData { /** * The version number of the version's corresponding Remote Config template. */ - versionNumber?: string; + versionNumber?: number; +} + +export enum UpdateOriginEnum { + AdminSDKNode = "ADMIN_SDK_NODE", + Console = "CONSOLE", + RESTAPI = "REST_API", + RemoteConfigUpdateOriginUnspecified = "REMOTE_CONFIG_UPDATE_ORIGIN_UNSPECIFIED", +} + +export enum UpdateTypeEnum { + ForcedUpdate = "FORCED_UPDATE", + IncrementalUpdate = "INCREMENTAL_UPDATE", + RemoteConfigUpdateTypeUnspecified = "REMOTE_CONFIG_UPDATE_TYPE_UNSPECIFIED", + Rollback = "ROLLBACK", } /**