diff --git a/protos/google/cloud/asset/v1/asset_service.proto b/protos/google/cloud/asset/v1/asset_service.proto index 73ffa9e4..80a3da24 100644 --- a/protos/google/cloud/asset/v1/asset_service.proto +++ b/protos/google/cloud/asset/v1/asset_service.proto @@ -193,9 +193,8 @@ service AssetService { // Represents the metadata of the longrunning operation for the // AnalyzeIamPolicyLongrunning rpc. message AnalyzeIamPolicyLongrunningMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Export asset request. @@ -244,6 +243,23 @@ message ExportAssetsRequest { // Required. Output configuration indicating where the results will be output to. OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A list of relationship types to export, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 6; } // The export asset response. This message is returned by the @@ -316,6 +332,23 @@ message ListAssetsRequest { // unspecified for the first `ListAssetsRequest`. It is a continuation of a // prior `ListAssets` call, and the API should return the next page of assets. string page_token = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it snapshots specified relationships. It returns an error if + // any of the [relationship_types] doesn't belong to the supported + // relationship types of the [asset_types] or if any of the [asset_types] + // doesn't belong to the source types of the [relationship_types]. + // * Otherwise: + // it snapshots the supported relationships for all [asset_types] or returns + // an error if any of the [asset_types] has no relationship support. + // An unspecified asset types field means all supported asset_types. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; } // ListAssets response. @@ -364,6 +397,24 @@ message BatchGetAssetsHistoryRequest { // returned. The returned results contain all temporal assets whose time // window overlap with read_time_window. TimeWindow read_time_window = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationships' history on the [asset_names]. It + // returns an error if any of the [relationship_types] doesn't belong to the + // supported relationship types of the [asset_names] or if any of the + // [asset_names]'s types doesn't belong to the source types of the + // [relationship_types]. + // * Otherwise: + // it outputs the supported relationships' history on the [asset_names] or + // returns an error if any of the [asset_names]'s types has no relationship + // support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 5 [(google.api.field_behavior) = OPTIONAL]; } // Batch get assets history response. @@ -682,6 +733,24 @@ message Feed { // guide](https://cloud.google.com/asset-inventory/docs/monitoring-asset-changes-with-condition) // for detailed instructions. google.type.Expr condition = 6; + + // A list of relationship types to output, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. + // * If specified: + // it outputs specified relationship updates on the [asset_names] or the + // [asset_types]. It returns an error if any of the [relationship_types] + // doesn't belong to the supported relationship types of the [asset_names] or + // [asset_types], or any of the [asset_names] or the [asset_types] doesn't + // belong to the source types of the [relationship_types]. + // * Otherwise: + // it outputs the supported relationships of the types of [asset_names] and + // [asset_types] or returns an error if any of the [asset_names] or the + // [asset_types] has no replationship support. + // See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types and relationship types. + repeated string relationship_types = 7; } // Search all resources request. @@ -1353,4 +1422,7 @@ enum ContentType { // The runtime OS Inventory information. OS_INVENTORY = 6; + + // The related resources. + RELATIONSHIP = 7; } diff --git a/protos/google/cloud/asset/v1/assets.proto b/protos/google/cloud/asset/v1/assets.proto index 7a9d47df..97bc4872 100644 --- a/protos/google/cloud/asset/v1/assets.proto +++ b/protos/google/cloud/asset/v1/assets.proto @@ -23,9 +23,11 @@ import "google/identity/accesscontextmanager/v1/access_level.proto"; import "google/identity/accesscontextmanager/v1/access_policy.proto"; import "google/cloud/osconfig/v1/inventory.proto"; import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; import "google/rpc/code.proto"; +import "google/api/annotations.proto"; option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1"; @@ -158,6 +160,10 @@ message Asset { // for more information. google.cloud.osconfig.v1.Inventory os_inventory = 12; + // The related assets of the asset of one relationship type. + // One asset only represents one type of relationship. + RelatedAssets related_assets = 13; + // The ancestry path of an asset in Google Cloud [resource // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), // represented as a list of relative resource names. An ancestry path starts @@ -219,6 +225,67 @@ message Resource { string location = 8; } +// The detailed related assets with the `relationship_type`. +message RelatedAssets { + // The detailed relationship attributes. + RelationshipAttributes relationship_attributes = 1; + + // The peer resources of the relationship. + repeated RelatedAsset assets = 2; +} + +// The relationship attributes which include `type`, `source_resource_type`, +// `target_resource_type` and `action`. +message RelationshipAttributes { + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string type = 4; + + // The source asset type. Example: `compute.googleapis.com/Instance` + string source_resource_type = 1; + + // The target asset type. Example: `compute.googleapis.com/Disk` + string target_resource_type = 2; + + // The detail of the relationship, e.g. `contains`, `attaches` + string action = 3; +} + +// An asset identify in Google Cloud which contains its name, type and +// ancestors. An asset can be any resource in the Google Cloud [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message RelatedAsset { + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string asset = 1 [(google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Asset" + }]; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // The ancestors of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 3; +} + // A result of Resource Search, containing information of a cloud resource. message ResourceSearchResult { // The full resource name of this resource. Example: diff --git a/protos/protos.d.ts b/protos/protos.d.ts index 3ee73be5..7fc04606 100644 --- a/protos/protos.d.ts +++ b/protos/protos.d.ts @@ -430,6 +430,9 @@ export namespace google { /** ExportAssetsRequest outputConfig */ outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + + /** ExportAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents an ExportAssetsRequest. */ @@ -456,6 +459,9 @@ export namespace google { /** ExportAssetsRequest outputConfig. */ public outputConfig?: (google.cloud.asset.v1.IOutputConfig|null); + /** ExportAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new ExportAssetsRequest instance using the specified properties. * @param [properties] Properties to set @@ -649,6 +655,9 @@ export namespace google { /** ListAssetsRequest pageToken */ pageToken?: (string|null); + + /** ListAssetsRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a ListAssetsRequest. */ @@ -678,6 +687,9 @@ export namespace google { /** ListAssetsRequest pageToken. */ public pageToken: string; + /** ListAssetsRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new ListAssetsRequest instance using the specified properties. * @param [properties] Properties to set @@ -865,6 +877,9 @@ export namespace google { /** BatchGetAssetsHistoryRequest readTimeWindow */ readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + + /** BatchGetAssetsHistoryRequest relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a BatchGetAssetsHistoryRequest. */ @@ -888,6 +903,9 @@ export namespace google { /** BatchGetAssetsHistoryRequest readTimeWindow. */ public readTimeWindow?: (google.cloud.asset.v1.ITimeWindow|null); + /** BatchGetAssetsHistoryRequest relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @param [properties] Properties to set @@ -2405,6 +2423,9 @@ export namespace google { /** Feed condition */ condition?: (google.type.IExpr|null); + + /** Feed relationshipTypes */ + relationshipTypes?: (string[]|null); } /** Represents a Feed. */ @@ -2434,6 +2455,9 @@ export namespace google { /** Feed condition. */ public condition?: (google.type.IExpr|null); + /** Feed relationshipTypes. */ + public relationshipTypes: string[]; + /** * Creates a new Feed instance using the specified properties. * @param [properties] Properties to set @@ -4853,7 +4877,8 @@ export namespace google { IAM_POLICY = 2, ORG_POLICY = 4, ACCESS_POLICY = 5, - OS_INVENTORY = 6 + OS_INVENTORY = 6, + RELATIONSHIP = 7 } /** Properties of a TemporalAsset. */ @@ -5111,6 +5136,9 @@ export namespace google { /** Asset osInventory */ osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset relatedAssets */ + relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** Asset ancestors */ ancestors?: (string[]|null); } @@ -5154,6 +5182,9 @@ export namespace google { /** Asset osInventory. */ public osInventory?: (google.cloud.osconfig.v1.IInventory|null); + /** Asset relatedAssets. */ + public relatedAssets?: (google.cloud.asset.v1.IRelatedAssets|null); + /** Asset ancestors. */ public ancestors: string[]; @@ -5357,6 +5388,312 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a RelatedAssets. */ + interface IRelatedAssets { + + /** RelatedAssets relationshipAttributes */ + relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets */ + assets?: (google.cloud.asset.v1.IRelatedAsset[]|null); + } + + /** Represents a RelatedAssets. */ + class RelatedAssets implements IRelatedAssets { + + /** + * Constructs a new RelatedAssets. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAssets); + + /** RelatedAssets relationshipAttributes. */ + public relationshipAttributes?: (google.cloud.asset.v1.IRelationshipAttributes|null); + + /** RelatedAssets assets. */ + public assets: google.cloud.asset.v1.IRelatedAsset[]; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAssets instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAssets): google.cloud.asset.v1.RelatedAssets; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @param message RelatedAssets message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAssets, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAssets; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAssets; + + /** + * Verifies a RelatedAssets message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAssets + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAssets; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @param message RelatedAssets + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAssets, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAssets to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelationshipAttributes. */ + interface IRelationshipAttributes { + + /** RelationshipAttributes type */ + type?: (string|null); + + /** RelationshipAttributes sourceResourceType */ + sourceResourceType?: (string|null); + + /** RelationshipAttributes targetResourceType */ + targetResourceType?: (string|null); + + /** RelationshipAttributes action */ + action?: (string|null); + } + + /** Represents a RelationshipAttributes. */ + class RelationshipAttributes implements IRelationshipAttributes { + + /** + * Constructs a new RelationshipAttributes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelationshipAttributes); + + /** RelationshipAttributes type. */ + public type: string; + + /** RelationshipAttributes sourceResourceType. */ + public sourceResourceType: string; + + /** RelationshipAttributes targetResourceType. */ + public targetResourceType: string; + + /** RelationshipAttributes action. */ + public action: string; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @param [properties] Properties to set + * @returns RelationshipAttributes instance + */ + public static create(properties?: google.cloud.asset.v1.IRelationshipAttributes): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @param message RelationshipAttributes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelationshipAttributes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Verifies a RelationshipAttributes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelationshipAttributes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelationshipAttributes; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @param message RelationshipAttributes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelationshipAttributes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelationshipAttributes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RelatedAsset. */ + interface IRelatedAsset { + + /** RelatedAsset asset */ + asset?: (string|null); + + /** RelatedAsset assetType */ + assetType?: (string|null); + + /** RelatedAsset ancestors */ + ancestors?: (string[]|null); + } + + /** Represents a RelatedAsset. */ + class RelatedAsset implements IRelatedAsset { + + /** + * Constructs a new RelatedAsset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.asset.v1.IRelatedAsset); + + /** RelatedAsset asset. */ + public asset: string; + + /** RelatedAsset assetType. */ + public assetType: string; + + /** RelatedAsset ancestors. */ + public ancestors: string[]; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @param [properties] Properties to set + * @returns RelatedAsset instance + */ + public static create(properties?: google.cloud.asset.v1.IRelatedAsset): google.cloud.asset.v1.RelatedAsset; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @param message RelatedAsset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.asset.v1.IRelatedAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.asset.v1.RelatedAsset; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.asset.v1.RelatedAsset; + + /** + * Verifies a RelatedAsset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelatedAsset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.asset.v1.RelatedAsset; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @param message RelatedAsset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.asset.v1.RelatedAsset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelatedAsset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a ResourceSearchResult. */ interface IResourceSearchResult { @@ -17662,6 +17999,102 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a Struct. */ interface IStruct { @@ -17970,102 +18403,6 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** Properties of an Any. */ - interface IAny { - - /** Any type_url */ - type_url?: (string|null); - - /** Any value */ - value?: (Uint8Array|string|null); - } - - /** Represents an Any. */ - class Any implements IAny { - - /** - * Constructs a new Any. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IAny); - - /** Any type_url. */ - public type_url: string; - - /** Any value. */ - public value: (Uint8Array|string); - - /** - * Creates a new Any instance using the specified properties. - * @param [properties] Properties to set - * @returns Any instance - */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Any message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; - - /** - * Verifies an Any message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Any - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Any to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - /** Properties of a Duration. */ interface IDuration { diff --git a/protos/protos.js b/protos/protos.js index 359de06a..a0d518d2 100644 --- a/protos/protos.js +++ b/protos/protos.js @@ -733,6 +733,7 @@ * @property {Array.|null} [assetTypes] ExportAssetsRequest assetTypes * @property {google.cloud.asset.v1.ContentType|null} [contentType] ExportAssetsRequest contentType * @property {google.cloud.asset.v1.IOutputConfig|null} [outputConfig] ExportAssetsRequest outputConfig + * @property {Array.|null} [relationshipTypes] ExportAssetsRequest relationshipTypes */ /** @@ -745,6 +746,7 @@ */ function ExportAssetsRequest(properties) { this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -791,6 +793,14 @@ */ ExportAssetsRequest.prototype.outputConfig = null; + /** + * ExportAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ExportAssetsRequest + * @instance + */ + ExportAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new ExportAssetsRequest instance using the specified properties. * @function create @@ -826,6 +836,9 @@ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.contentType); if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) $root.google.cloud.asset.v1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.relationshipTypes[i]); return writer; }; @@ -877,6 +890,11 @@ case 5: message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.decode(reader, reader.uint32()); break; + case 6: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -937,6 +955,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { @@ -944,6 +963,13 @@ if (error) return "outputConfig." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -998,12 +1024,23 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.outputConfig != null) { if (typeof object.outputConfig !== "object") throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.outputConfig: object expected"); message.outputConfig = $root.google.cloud.asset.v1.OutputConfig.fromObject(object.outputConfig); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ExportAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -1020,8 +1057,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetTypes = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.readTime = null; @@ -1041,6 +1080,11 @@ object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) object.outputConfig = $root.google.cloud.asset.v1.OutputConfig.toObject(message.outputConfig, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -1317,6 +1361,7 @@ * @property {google.cloud.asset.v1.ContentType|null} [contentType] ListAssetsRequest contentType * @property {number|null} [pageSize] ListAssetsRequest pageSize * @property {string|null} [pageToken] ListAssetsRequest pageToken + * @property {Array.|null} [relationshipTypes] ListAssetsRequest relationshipTypes */ /** @@ -1329,6 +1374,7 @@ */ function ListAssetsRequest(properties) { this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1383,6 +1429,14 @@ */ ListAssetsRequest.prototype.pageToken = ""; + /** + * ListAssetsRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.ListAssetsRequest + * @instance + */ + ListAssetsRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new ListAssetsRequest instance using the specified properties. * @function create @@ -1420,6 +1474,9 @@ writer.uint32(/* id 5, wireType 0 =*/40).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); return writer; }; @@ -1474,6 +1531,11 @@ case 6: message.pageToken = reader.string(); break; + case 7: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -1534,6 +1596,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -1542,6 +1605,13 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -1596,11 +1666,22 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.ListAssetsRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -1617,8 +1698,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetTypes = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.readTime = null; @@ -1641,6 +1724,11 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -1927,6 +2015,7 @@ * @property {Array.|null} [assetNames] BatchGetAssetsHistoryRequest assetNames * @property {google.cloud.asset.v1.ContentType|null} [contentType] BatchGetAssetsHistoryRequest contentType * @property {google.cloud.asset.v1.ITimeWindow|null} [readTimeWindow] BatchGetAssetsHistoryRequest readTimeWindow + * @property {Array.|null} [relationshipTypes] BatchGetAssetsHistoryRequest relationshipTypes */ /** @@ -1939,6 +2028,7 @@ */ function BatchGetAssetsHistoryRequest(properties) { this.assetNames = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1977,6 +2067,14 @@ */ BatchGetAssetsHistoryRequest.prototype.readTimeWindow = null; + /** + * BatchGetAssetsHistoryRequest relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.BatchGetAssetsHistoryRequest + * @instance + */ + BatchGetAssetsHistoryRequest.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new BatchGetAssetsHistoryRequest instance using the specified properties. * @function create @@ -2010,6 +2108,9 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contentType); if (message.readTimeWindow != null && Object.hasOwnProperty.call(message, "readTimeWindow")) $root.google.cloud.asset.v1.TimeWindow.encode(message.readTimeWindow, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.relationshipTypes[i]); return writer; }; @@ -2058,6 +2159,11 @@ case 4: message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.decode(reader, reader.uint32()); break; + case 5: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -2113,6 +2219,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) { @@ -2120,6 +2227,13 @@ if (error) return "readTimeWindow." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -2169,12 +2283,23 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.readTimeWindow != null) { if (typeof object.readTimeWindow !== "object") throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.readTimeWindow: object expected"); message.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.fromObject(object.readTimeWindow); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.BatchGetAssetsHistoryRequest.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -2191,8 +2316,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.assetNames = []; + object.relationshipTypes = []; + } if (options.defaults) { object.parent = ""; object.contentType = options.enums === String ? "CONTENT_TYPE_UNSPECIFIED" : 0; @@ -2209,6 +2336,11 @@ object.contentType = options.enums === String ? $root.google.cloud.asset.v1.ContentType[message.contentType] : message.contentType; if (message.readTimeWindow != null && message.hasOwnProperty("readTimeWindow")) object.readTimeWindow = $root.google.cloud.asset.v1.TimeWindow.toObject(message.readTimeWindow, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -5464,6 +5596,7 @@ * @property {google.cloud.asset.v1.ContentType|null} [contentType] Feed contentType * @property {google.cloud.asset.v1.IFeedOutputConfig|null} [feedOutputConfig] Feed feedOutputConfig * @property {google.type.IExpr|null} [condition] Feed condition + * @property {Array.|null} [relationshipTypes] Feed relationshipTypes */ /** @@ -5477,6 +5610,7 @@ function Feed(properties) { this.assetNames = []; this.assetTypes = []; + this.relationshipTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5531,6 +5665,14 @@ */ Feed.prototype.condition = null; + /** + * Feed relationshipTypes. + * @member {Array.} relationshipTypes + * @memberof google.cloud.asset.v1.Feed + * @instance + */ + Feed.prototype.relationshipTypes = $util.emptyArray; + /** * Creates a new Feed instance using the specified properties. * @function create @@ -5569,6 +5711,9 @@ $root.google.cloud.asset.v1.FeedOutputConfig.encode(message.feedOutputConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.relationshipTypes != null && message.relationshipTypes.length) + for (var i = 0; i < message.relationshipTypes.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.relationshipTypes[i]); return writer; }; @@ -5625,6 +5770,11 @@ case 6: message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); break; + case 7: + if (!(message.relationshipTypes && message.relationshipTypes.length)) + message.relationshipTypes = []; + message.relationshipTypes.push(reader.string()); + break; default: reader.skipType(tag & 7); break; @@ -5687,6 +5837,7 @@ case 4: case 5: case 6: + case 7: break; } if (message.feedOutputConfig != null && message.hasOwnProperty("feedOutputConfig")) { @@ -5699,6 +5850,13 @@ if (error) return "condition." + error; } + if (message.relationshipTypes != null && message.hasOwnProperty("relationshipTypes")) { + if (!Array.isArray(message.relationshipTypes)) + return "relationshipTypes: array expected"; + for (var i = 0; i < message.relationshipTypes.length; ++i) + if (!$util.isString(message.relationshipTypes[i])) + return "relationshipTypes: string[] expected"; + } return null; }; @@ -5755,6 +5913,10 @@ case 6: message.contentType = 6; break; + case "RELATIONSHIP": + case 7: + message.contentType = 7; + break; } if (object.feedOutputConfig != null) { if (typeof object.feedOutputConfig !== "object") @@ -5766,6 +5928,13 @@ throw TypeError(".google.cloud.asset.v1.Feed.condition: object expected"); message.condition = $root.google.type.Expr.fromObject(object.condition); } + if (object.relationshipTypes) { + if (!Array.isArray(object.relationshipTypes)) + throw TypeError(".google.cloud.asset.v1.Feed.relationshipTypes: array expected"); + message.relationshipTypes = []; + for (var i = 0; i < object.relationshipTypes.length; ++i) + message.relationshipTypes[i] = String(object.relationshipTypes[i]); + } return message; }; @@ -5785,6 +5954,7 @@ if (options.arrays || options.defaults) { object.assetNames = []; object.assetTypes = []; + object.relationshipTypes = []; } if (options.defaults) { object.name = ""; @@ -5810,6 +5980,11 @@ object.feedOutputConfig = $root.google.cloud.asset.v1.FeedOutputConfig.toObject(message.feedOutputConfig, options); if (message.condition != null && message.hasOwnProperty("condition")) object.condition = $root.google.type.Expr.toObject(message.condition, options); + if (message.relationshipTypes && message.relationshipTypes.length) { + object.relationshipTypes = []; + for (var j = 0; j < message.relationshipTypes.length; ++j) + object.relationshipTypes[j] = message.relationshipTypes[j]; + } return object; }; @@ -11460,6 +11635,7 @@ * @property {number} ORG_POLICY=4 ORG_POLICY value * @property {number} ACCESS_POLICY=5 ACCESS_POLICY value * @property {number} OS_INVENTORY=6 OS_INVENTORY value + * @property {number} RELATIONSHIP=7 RELATIONSHIP value */ v1.ContentType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -11469,6 +11645,7 @@ values[valuesById[4] = "ORG_POLICY"] = 4; values[valuesById[5] = "ACCESS_POLICY"] = 5; values[valuesById[6] = "OS_INVENTORY"] = 6; + values[valuesById[7] = "RELATIONSHIP"] = 7; return values; })(); @@ -12047,6 +12224,7 @@ * @property {google.identity.accesscontextmanager.v1.IAccessLevel|null} [accessLevel] Asset accessLevel * @property {google.identity.accesscontextmanager.v1.IServicePerimeter|null} [servicePerimeter] Asset servicePerimeter * @property {google.cloud.osconfig.v1.IInventory|null} [osInventory] Asset osInventory + * @property {google.cloud.asset.v1.IRelatedAssets|null} [relatedAssets] Asset relatedAssets * @property {Array.|null} [ancestors] Asset ancestors */ @@ -12147,6 +12325,14 @@ */ Asset.prototype.osInventory = null; + /** + * Asset relatedAssets. + * @member {google.cloud.asset.v1.IRelatedAssets|null|undefined} relatedAssets + * @memberof google.cloud.asset.v1.Asset + * @instance + */ + Asset.prototype.relatedAssets = null; + /** * Asset ancestors. * @member {Array.} ancestors @@ -12217,6 +12403,8 @@ $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.osInventory != null && Object.hasOwnProperty.call(message, "osInventory")) $root.google.cloud.osconfig.v1.Inventory.encode(message.osInventory, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.relatedAssets != null && Object.hasOwnProperty.call(message, "relatedAssets")) + $root.google.cloud.asset.v1.RelatedAssets.encode(message.relatedAssets, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); return writer; }; @@ -12283,6 +12471,9 @@ case 12: message.osInventory = $root.google.cloud.osconfig.v1.Inventory.decode(reader, reader.uint32()); break; + case 13: + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.decode(reader, reader.uint32()); + break; case 10: if (!(message.ancestors && message.ancestors.length)) message.ancestors = []; @@ -12387,6 +12578,11 @@ if (error) return "osInventory." + error; } + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) { + var error = $root.google.cloud.asset.v1.RelatedAssets.verify(message.relatedAssets); + if (error) + return "relatedAssets." + error; + } if (message.ancestors != null && message.hasOwnProperty("ancestors")) { if (!Array.isArray(message.ancestors)) return "ancestors: array expected"; @@ -12458,6 +12654,11 @@ throw TypeError(".google.cloud.asset.v1.Asset.osInventory: object expected"); message.osInventory = $root.google.cloud.osconfig.v1.Inventory.fromObject(object.osInventory); } + if (object.relatedAssets != null) { + if (typeof object.relatedAssets !== "object") + throw TypeError(".google.cloud.asset.v1.Asset.relatedAssets: object expected"); + message.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.fromObject(object.relatedAssets); + } if (object.ancestors) { if (!Array.isArray(object.ancestors)) throw TypeError(".google.cloud.asset.v1.Asset.ancestors: array expected"); @@ -12492,6 +12693,7 @@ object.iamPolicy = null; object.updateTime = null; object.osInventory = null; + object.relatedAssets = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -12530,6 +12732,8 @@ object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); if (message.osInventory != null && message.hasOwnProperty("osInventory")) object.osInventory = $root.google.cloud.osconfig.v1.Inventory.toObject(message.osInventory, options); + if (message.relatedAssets != null && message.hasOwnProperty("relatedAssets")) + object.relatedAssets = $root.google.cloud.asset.v1.RelatedAssets.toObject(message.relatedAssets, options); return object; }; @@ -12872,6 +13076,745 @@ return Resource; })(); + v1.RelatedAssets = (function() { + + /** + * Properties of a RelatedAssets. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAssets + * @property {google.cloud.asset.v1.IRelationshipAttributes|null} [relationshipAttributes] RelatedAssets relationshipAttributes + * @property {Array.|null} [assets] RelatedAssets assets + */ + + /** + * Constructs a new RelatedAssets. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAssets. + * @implements IRelatedAssets + * @constructor + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + */ + function RelatedAssets(properties) { + this.assets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAssets relationshipAttributes. + * @member {google.cloud.asset.v1.IRelationshipAttributes|null|undefined} relationshipAttributes + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.relationshipAttributes = null; + + /** + * RelatedAssets assets. + * @member {Array.} assets + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + */ + RelatedAssets.prototype.assets = $util.emptyArray; + + /** + * Creates a new RelatedAssets instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets instance + */ + RelatedAssets.create = function create(properties) { + return new RelatedAssets(properties); + }; + + /** + * Encodes the specified RelatedAssets message. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relationshipAttributes != null && Object.hasOwnProperty.call(message, "relationshipAttributes")) + $root.google.cloud.asset.v1.RelationshipAttributes.encode(message.relationshipAttributes, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.assets != null && message.assets.length) + for (var i = 0; i < message.assets.length; ++i) + $root.google.cloud.asset.v1.RelatedAsset.encode(message.assets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelatedAssets message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAssets.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.IRelatedAssets} message RelatedAssets message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAssets.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedAssets(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.assets && message.assets.length)) + message.assets = []; + message.assets.push($root.google.cloud.asset.v1.RelatedAsset.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAssets message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAssets.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAssets message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAssets.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) { + var error = $root.google.cloud.asset.v1.RelationshipAttributes.verify(message.relationshipAttributes); + if (error) + return "relationshipAttributes." + error; + } + if (message.assets != null && message.hasOwnProperty("assets")) { + if (!Array.isArray(message.assets)) + return "assets: array expected"; + for (var i = 0; i < message.assets.length; ++i) { + var error = $root.google.cloud.asset.v1.RelatedAsset.verify(message.assets[i]); + if (error) + return "assets." + error; + } + } + return null; + }; + + /** + * Creates a RelatedAssets message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAssets} RelatedAssets + */ + RelatedAssets.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAssets) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAssets(); + if (object.relationshipAttributes != null) { + if (typeof object.relationshipAttributes !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.relationshipAttributes: object expected"); + message.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.fromObject(object.relationshipAttributes); + } + if (object.assets) { + if (!Array.isArray(object.assets)) + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: array expected"); + message.assets = []; + for (var i = 0; i < object.assets.length; ++i) { + if (typeof object.assets[i] !== "object") + throw TypeError(".google.cloud.asset.v1.RelatedAssets.assets: object expected"); + message.assets[i] = $root.google.cloud.asset.v1.RelatedAsset.fromObject(object.assets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RelatedAssets message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAssets + * @static + * @param {google.cloud.asset.v1.RelatedAssets} message RelatedAssets + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAssets.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.assets = []; + if (options.defaults) + object.relationshipAttributes = null; + if (message.relationshipAttributes != null && message.hasOwnProperty("relationshipAttributes")) + object.relationshipAttributes = $root.google.cloud.asset.v1.RelationshipAttributes.toObject(message.relationshipAttributes, options); + if (message.assets && message.assets.length) { + object.assets = []; + for (var j = 0; j < message.assets.length; ++j) + object.assets[j] = $root.google.cloud.asset.v1.RelatedAsset.toObject(message.assets[j], options); + } + return object; + }; + + /** + * Converts this RelatedAssets to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAssets + * @instance + * @returns {Object.} JSON object + */ + RelatedAssets.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAssets; + })(); + + v1.RelationshipAttributes = (function() { + + /** + * Properties of a RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @interface IRelationshipAttributes + * @property {string|null} [type] RelationshipAttributes type + * @property {string|null} [sourceResourceType] RelationshipAttributes sourceResourceType + * @property {string|null} [targetResourceType] RelationshipAttributes targetResourceType + * @property {string|null} [action] RelationshipAttributes action + */ + + /** + * Constructs a new RelationshipAttributes. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelationshipAttributes. + * @implements IRelationshipAttributes + * @constructor + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + */ + function RelationshipAttributes(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelationshipAttributes type. + * @member {string} type + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.type = ""; + + /** + * RelationshipAttributes sourceResourceType. + * @member {string} sourceResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.sourceResourceType = ""; + + /** + * RelationshipAttributes targetResourceType. + * @member {string} targetResourceType + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.targetResourceType = ""; + + /** + * RelationshipAttributes action. + * @member {string} action + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + */ + RelationshipAttributes.prototype.action = ""; + + /** + * Creates a new RelationshipAttributes instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes instance + */ + RelationshipAttributes.create = function create(properties) { + return new RelationshipAttributes(properties); + }; + + /** + * Encodes the specified RelationshipAttributes message. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceResourceType != null && Object.hasOwnProperty.call(message, "sourceResourceType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceResourceType); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetResourceType); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + return writer; + }; + + /** + * Encodes the specified RelationshipAttributes message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelationshipAttributes.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.IRelationshipAttributes} message RelationshipAttributes message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelationshipAttributes.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelationshipAttributes(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.type = reader.string(); + break; + case 1: + message.sourceResourceType = reader.string(); + break; + case 2: + message.targetResourceType = reader.string(); + break; + case 3: + message.action = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelationshipAttributes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelationshipAttributes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelationshipAttributes message. + * @function verify + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelationshipAttributes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + if (!$util.isString(message.sourceResourceType)) + return "sourceResourceType: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + if (!$util.isString(message.targetResourceType)) + return "targetResourceType: string expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + return null; + }; + + /** + * Creates a RelationshipAttributes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelationshipAttributes} RelationshipAttributes + */ + RelationshipAttributes.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelationshipAttributes) + return object; + var message = new $root.google.cloud.asset.v1.RelationshipAttributes(); + if (object.type != null) + message.type = String(object.type); + if (object.sourceResourceType != null) + message.sourceResourceType = String(object.sourceResourceType); + if (object.targetResourceType != null) + message.targetResourceType = String(object.targetResourceType); + if (object.action != null) + message.action = String(object.action); + return message; + }; + + /** + * Creates a plain object from a RelationshipAttributes message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @static + * @param {google.cloud.asset.v1.RelationshipAttributes} message RelationshipAttributes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelationshipAttributes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceResourceType = ""; + object.targetResourceType = ""; + object.action = ""; + object.type = ""; + } + if (message.sourceResourceType != null && message.hasOwnProperty("sourceResourceType")) + object.sourceResourceType = message.sourceResourceType; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = message.targetResourceType; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this RelationshipAttributes to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelationshipAttributes + * @instance + * @returns {Object.} JSON object + */ + RelationshipAttributes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelationshipAttributes; + })(); + + v1.RelatedAsset = (function() { + + /** + * Properties of a RelatedAsset. + * @memberof google.cloud.asset.v1 + * @interface IRelatedAsset + * @property {string|null} [asset] RelatedAsset asset + * @property {string|null} [assetType] RelatedAsset assetType + * @property {Array.|null} [ancestors] RelatedAsset ancestors + */ + + /** + * Constructs a new RelatedAsset. + * @memberof google.cloud.asset.v1 + * @classdesc Represents a RelatedAsset. + * @implements IRelatedAsset + * @constructor + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + */ + function RelatedAsset(properties) { + this.ancestors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelatedAsset asset. + * @member {string} asset + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.asset = ""; + + /** + * RelatedAsset assetType. + * @member {string} assetType + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.assetType = ""; + + /** + * RelatedAsset ancestors. + * @member {Array.} ancestors + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + */ + RelatedAsset.prototype.ancestors = $util.emptyArray; + + /** + * Creates a new RelatedAsset instance using the specified properties. + * @function create + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset=} [properties] Properties to set + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset instance + */ + RelatedAsset.create = function create(properties) { + return new RelatedAsset(properties); + }; + + /** + * Encodes the specified RelatedAsset message. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.asset != null && Object.hasOwnProperty.call(message, "asset")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.asset); + if (message.assetType != null && Object.hasOwnProperty.call(message, "assetType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.assetType); + if (message.ancestors != null && message.ancestors.length) + for (var i = 0; i < message.ancestors.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ancestors[i]); + return writer; + }; + + /** + * Encodes the specified RelatedAsset message, length delimited. Does not implicitly {@link google.cloud.asset.v1.RelatedAsset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.IRelatedAsset} message RelatedAsset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelatedAsset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.asset.v1.RelatedAsset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.asset = reader.string(); + break; + case 2: + message.assetType = reader.string(); + break; + case 3: + if (!(message.ancestors && message.ancestors.length)) + message.ancestors = []; + message.ancestors.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelatedAsset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelatedAsset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelatedAsset message. + * @function verify + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelatedAsset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.asset != null && message.hasOwnProperty("asset")) + if (!$util.isString(message.asset)) + return "asset: string expected"; + if (message.assetType != null && message.hasOwnProperty("assetType")) + if (!$util.isString(message.assetType)) + return "assetType: string expected"; + if (message.ancestors != null && message.hasOwnProperty("ancestors")) { + if (!Array.isArray(message.ancestors)) + return "ancestors: array expected"; + for (var i = 0; i < message.ancestors.length; ++i) + if (!$util.isString(message.ancestors[i])) + return "ancestors: string[] expected"; + } + return null; + }; + + /** + * Creates a RelatedAsset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.asset.v1.RelatedAsset} RelatedAsset + */ + RelatedAsset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.asset.v1.RelatedAsset) + return object; + var message = new $root.google.cloud.asset.v1.RelatedAsset(); + if (object.asset != null) + message.asset = String(object.asset); + if (object.assetType != null) + message.assetType = String(object.assetType); + if (object.ancestors) { + if (!Array.isArray(object.ancestors)) + throw TypeError(".google.cloud.asset.v1.RelatedAsset.ancestors: array expected"); + message.ancestors = []; + for (var i = 0; i < object.ancestors.length; ++i) + message.ancestors[i] = String(object.ancestors[i]); + } + return message; + }; + + /** + * Creates a plain object from a RelatedAsset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.asset.v1.RelatedAsset + * @static + * @param {google.cloud.asset.v1.RelatedAsset} message RelatedAsset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelatedAsset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ancestors = []; + if (options.defaults) { + object.asset = ""; + object.assetType = ""; + } + if (message.asset != null && message.hasOwnProperty("asset")) + object.asset = message.asset; + if (message.assetType != null && message.hasOwnProperty("assetType")) + object.assetType = message.assetType; + if (message.ancestors && message.ancestors.length) { + object.ancestors = []; + for (var j = 0; j < message.ancestors.length; ++j) + object.ancestors[j] = message.ancestors[j]; + } + return object; + }; + + /** + * Converts this RelatedAsset to JSON. + * @function toJSON + * @memberof google.cloud.asset.v1.RelatedAsset + * @instance + * @returns {Object.} JSON object + */ + RelatedAsset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RelatedAsset; + })(); + v1.ResourceSearchResult = (function() { /** @@ -44488,6 +45431,225 @@ return Timestamp; })(); + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type_url = reader.string(); + break; + case 2: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Any; + })(); + protobuf.Struct = (function() { /** @@ -45302,225 +46464,6 @@ return ListValue; })(); - protobuf.Any = (function() { - - /** - * Properties of an Any. - * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value - */ - - /** - * Constructs a new Any. - * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny - * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set - */ - function Any(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.type_url = ""; - - /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any - * @instance - */ - Any.prototype.value = $util.newBuffer([]); - - /** - * Creates a new Any instance using the specified properties. - * @function create - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance - */ - Any.create = function create(properties) { - return new Any(properties); - }; - - /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encode - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); - return writer; - }; - - /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Any.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Any message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.type_url = reader.string(); - break; - case 2: - message.value = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Any message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.Any - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Any.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Any message. - * @function verify - * @memberof google.protobuf.Any - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Any.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; - return null; - }; - - /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.Any - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any - */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) - return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; - return message; - }; - - /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.Any - * @static - * @param {google.protobuf.Any} message Any - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Any.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } - } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - return object; - }; - - /** - * Converts this Any to JSON. - * @function toJSON - * @memberof google.protobuf.Any - * @instance - * @returns {Object.} JSON object - */ - Any.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Any; - })(); - protobuf.Duration = (function() { /** diff --git a/protos/protos.json b/protos/protos.json index f9d2d38d..725e85c1 100644 --- a/protos/protos.json +++ b/protos/protos.json @@ -303,6 +303,11 @@ "options": { "(google.api.field_behavior)": "REQUIRED" } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 6 } } }, @@ -352,6 +357,11 @@ "pageToken": { "type": "string", "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 } } }, @@ -400,6 +410,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -671,6 +689,11 @@ "condition": { "type": "google.type.Expr", "id": 6 + }, + "relationshipTypes": { + "rule": "repeated", + "type": "string", + "id": 7 } } }, @@ -1195,7 +1218,8 @@ "IAM_POLICY": 2, "ORG_POLICY": 4, "ACCESS_POLICY": 5, - "OS_INVENTORY": 6 + "OS_INVENTORY": 6, + "RELATIONSHIP": 7 } }, "TemporalAsset": { @@ -1301,6 +1325,10 @@ "type": "google.cloud.osconfig.v1.Inventory", "id": 12 }, + "relatedAssets": { + "type": "RelatedAssets", + "id": 13 + }, "ancestors": { "rule": "repeated", "type": "string", @@ -1340,6 +1368,59 @@ } } }, + "RelatedAssets": { + "fields": { + "relationshipAttributes": { + "type": "RelationshipAttributes", + "id": 1 + }, + "assets": { + "rule": "repeated", + "type": "RelatedAsset", + "id": 2 + } + } + }, + "RelationshipAttributes": { + "fields": { + "type": { + "type": "string", + "id": 4 + }, + "sourceResourceType": { + "type": "string", + "id": 1 + }, + "targetResourceType": { + "type": "string", + "id": 2 + }, + "action": { + "type": "string", + "id": 3 + } + } + }, + "RelatedAsset": { + "fields": { + "asset": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudasset.googleapis.com/Asset" + } + }, + "assetType": { + "type": "string", + "id": 2 + }, + "ancestors": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, "ResourceSearchResult": { "fields": { "name": { @@ -4467,6 +4548,18 @@ } } }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, "Struct": { "fields": { "fields": { @@ -4530,18 +4623,6 @@ } } }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, "Duration": { "fields": { "seconds": { diff --git a/src/v1/asset_service_client.ts b/src/v1/asset_service_client.ts index bc759ef5..f6016afb 100644 --- a/src/v1/asset_service_client.ts +++ b/src/v1/asset_service_client.ts @@ -455,6 +455,23 @@ export class AssetServiceClient { * If start_time is not set, the snapshot of the assets at end_time will be * returned. The returned results contain all temporal assets whose time * window overlap with read_time_window. + * @param {string[]} [request.relationshipTypes] + * Optional. A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it outputs specified relationships' history on the [asset_names]. It + * returns an error if any of the [relationship_types] doesn't belong to the + * supported relationship types of the [asset_names] or if any of the + * [asset_names]'s types doesn't belong to the source types of the + * [relationship_types]. + * * Otherwise: + * it outputs the supported relationships' history on the [asset_names] or + * returns an error if any of the [asset_names]'s types has no relationship + * support. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1235,6 +1252,22 @@ export class AssetServiceClient { * returned. * @param {google.cloud.asset.v1.OutputConfig} request.outputConfig * Required. Output configuration indicating where the results will be output to. + * @param {string[]} request.relationshipTypes + * A list of relationship types to export, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + * supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1561,6 +1594,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1658,6 +1707,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1737,6 +1802,22 @@ export class AssetServiceClient { * The `next_page_token` returned from the previous `ListAssetsResponse`, or * unspecified for the first `ListAssetsRequest`. It is a continuation of a * prior `ListAssets` call, and the API should return the next page of assets. + * @param {string[]} request.relationshipTypes + * A list of relationship types to output, for example: + * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + * content_type=RELATIONSHIP. + * * If specified: + * it snapshots specified relationships. It returns an error if + * any of the [relationship_types] doesn't belong to the supported + * relationship types of the [asset_types] or if any of the [asset_types] + * doesn't belong to the source types of the [relationship_types]. + * * Otherwise: + * it snapshots the supported relationships for all [asset_types] or returns + * an error if any of the [asset_types] has no relationship support. + * An unspecified asset types field means all supported asset_types. + * See [Introduction to Cloud Asset + * Inventory](https://cloud.google.com/asset-inventory/docs/overview) + * for all supported asset types and relationship types. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object}