From 8ffed36c9db818a24073cf865f626d29afd01716 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 15 Sep 2021 15:40:16 -0700 Subject: [PATCH] chore(all): auto-regenerate gapics (#4757) This is an auto-generated regeneration of the gapic clients by cloud.google.com/go/internal/gapicgen. Once the corresponding genproto PR is submitted, genbot will update this PR with a newer dependency to the newer version of genproto and assign reviewers to this PR. If you have been assigned to review this PR, please: - Ensure that the version of genproto in go.mod has been updated. - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. Corresponding genproto PR: https://github.com/googleapis/go-genproto/pull/675 Changes: feat(functions): add SecurityLevel option on HttpsTrigger PiperOrigin-RevId: 396889803 Source-Link: https://github.com/googleapis/googleapis/commit/44c497f37f1959360f28ff12d20e3a7c9429378f docs(bigquery/storage): Align session length with public documentation feat: Expose estimated bytes that a session will scan. Committer: @emkornfield PiperOrigin-RevId: 396849937 Source-Link: https://github.com/googleapis/googleapis/commit/56614520e4e6c47737a91601f89e48e5eefb5d7b feat(talent): Added a new `KeywordMatchMode` field to support more keyword matching options feat: Added more `DiversificationLevel` configuration options PiperOrigin-RevId: 396667150 Source-Link: https://github.com/googleapis/googleapis/commit/caad48d4b6f28a3a44732ceeeca871ce335f48ec chore(accessapproval): remove nonexistent method from config PiperOrigin-RevId: 396610698 Source-Link: https://github.com/googleapis/googleapis/commit/bdde0473f9532e898851b34f1d48ebcc2d02d1e1 --- accessapproval/apiv1/doc.go | 2 +- accessapproval/go.mod | 6 +- accessapproval/go.sum | 16 ++- .../storage/apiv1/big_query_read_client.go | 2 +- bigquery/storage/apiv1/doc.go | 2 +- compute/apiv1/accelerator_types_client.go | 5 +- compute/apiv1/addresses_client.go | 9 +- compute/apiv1/autoscalers_client.go | 13 ++- compute/apiv1/backend_buckets_client.go | 17 +-- compute/apiv1/backend_services_client.go | 24 ++-- compute/apiv1/disk_types_client.go | 5 +- compute/apiv1/disks_client.go | 34 ++++-- compute/apiv1/doc.go | 15 ++- compute/apiv1/external_vpn_gateways_client.go | 16 ++- compute/apiv1/firewall_policies_client.go | 55 ++++++--- compute/apiv1/firewalls_client.go | 13 ++- compute/apiv1/forwarding_rules_client.go | 15 ++- compute/apiv1/global_addresses_client.go | 9 +- .../apiv1/global_forwarding_rules_client.go | 15 ++- .../global_network_endpoint_groups_client.go | 13 ++- compute/apiv1/global_operations_client.go | 15 ++- .../global_organization_operations_client.go | 10 +- ...global_public_delegated_prefixes_client.go | 11 +- compute/apiv1/health_checks_client.go | 13 ++- compute/apiv1/images_client.go | 35 ++++-- .../apiv1/instance_group_managers_client.go | 33 +++--- compute/apiv1/instance_groups_client.go | 15 ++- compute/apiv1/instance_templates_client.go | 24 +++- compute/apiv1/instances_client.go | 105 +++++++++++------- .../apiv1/interconnect_attachments_client.go | 11 +- .../apiv1/interconnect_locations_client.go | 5 +- compute/apiv1/interconnects_client.go | 16 ++- compute/apiv1/license_codes_client.go | 10 +- compute/apiv1/licenses_client.go | 24 +++- compute/apiv1/machine_types_client.go | 5 +- .../apiv1/network_endpoint_groups_client.go | 18 ++- compute/apiv1/networks_client.go | 24 ++-- compute/apiv1/node_groups_client.go | 32 ++++-- compute/apiv1/node_templates_client.go | 24 +++- compute/apiv1/node_types_client.go | 5 +- compute/apiv1/packet_mirrorings_client.go | 16 ++- compute/apiv1/projects_client.go | 28 +++-- .../public_advertised_prefixes_client.go | 11 +- .../apiv1/public_delegated_prefixes_client.go | 11 +- compute/apiv1/region_autoscalers_client.go | 13 ++- .../apiv1/region_backend_services_client.go | 18 ++- compute/apiv1/region_commitments_client.go | 7 +- compute/apiv1/region_disk_types_client.go | 5 +- compute/apiv1/region_disks_client.go | 34 ++++-- .../region_health_check_services_client.go | 11 +- compute/apiv1/region_health_checks_client.go | 13 ++- .../region_instance_group_managers_client.go | 33 +++--- .../apiv1/region_instance_groups_client.go | 7 +- compute/apiv1/region_instances_client.go | 2 +- .../region_network_endpoint_groups_client.go | 9 +- .../region_notification_endpoints_client.go | 9 +- compute/apiv1/region_operations_client.go | 15 ++- .../apiv1/region_ssl_certificates_client.go | 9 +- .../region_target_http_proxies_client.go | 11 +- .../region_target_https_proxies_client.go | 13 ++- compute/apiv1/region_url_maps_client.go | 18 ++- compute/apiv1/regions_client.go | 5 +- compute/apiv1/reservations_client.go | 26 +++-- compute/apiv1/resource_policies_client.go | 24 +++- compute/apiv1/routers_client.go | 23 ++-- compute/apiv1/routes_client.go | 9 +- compute/apiv1/security_policies_client.go | 27 +++-- compute/apiv1/snapshots_client.go | 24 +++- compute/apiv1/ssl_certificates_client.go | 9 +- compute/apiv1/ssl_policies_client.go | 16 ++- compute/apiv1/subnetworks_client.go | 30 +++-- compute/apiv1/target_grpc_proxies_client.go | 11 +- compute/apiv1/target_http_proxies_client.go | 13 ++- compute/apiv1/target_https_proxies_client.go | 19 ++-- compute/apiv1/target_instances_client.go | 9 +- compute/apiv1/target_pools_client.go | 24 ++-- compute/apiv1/target_ssl_proxies_client.go | 17 +-- compute/apiv1/target_tcp_proxies_client.go | 13 ++- compute/apiv1/target_vpn_gateways_client.go | 9 +- compute/apiv1/url_maps_client.go | 20 ++-- compute/apiv1/vpn_gateways_client.go | 21 +++- compute/apiv1/vpn_tunnels_client.go | 9 +- compute/apiv1/zone_operations_client.go | 15 ++- compute/apiv1/zones_client.go | 5 +- functions/apiv1/doc.go | 2 +- functions/go.mod | 6 +- functions/go.sum | 16 ++- internal/.repo-metadata-full.json | 2 +- spanner/go.sum | 2 - talent/apiv4/doc.go | 2 +- talent/go.mod | 6 +- talent/go.sum | 16 ++- 92 files changed, 961 insertions(+), 483 deletions(-) diff --git a/accessapproval/apiv1/doc.go b/accessapproval/apiv1/doc.go index 27b6945c440..7dac84e026b 100644 --- a/accessapproval/apiv1/doc.go +++ b/accessapproval/apiv1/doc.go @@ -90,7 +90,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210821" +const versionClient = "20210915" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/accessapproval/go.mod b/accessapproval/go.mod index 2c9b04dd8f9..92e21917768 100644 --- a/accessapproval/go.mod +++ b/accessapproval/go.mod @@ -4,9 +4,9 @@ go 1.16 require ( cloud.google.com/go v0.93.3 - github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.54.0 - google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 + github.com/googleapis/gax-go/v2 v2.1.0 + google.golang.org/api v0.56.0 + google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/accessapproval/go.sum b/accessapproval/go.sum index 5bfcfa190f2..616387f958e 100644 --- a/accessapproval/go.sum +++ b/accessapproval/go.sum @@ -138,8 +138,9 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -263,8 +264,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -318,8 +320,9 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -414,8 +417,9 @@ google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59t google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0 h1:ECJUVngj71QI6XEm7b1sAf8BljU5inEhMbKPR8Lxhhk= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0 h1:08F9XVYTLOGeSQb3xI9C0gXMuQanhdGed0cWFhDozbI= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -474,8 +478,10 @@ google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 h1:XosVttQUxX8erNhEruTu053/VchgYuksoS9Bj/OITjU= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af h1:aLMMXFYqw01RA6XJim5uaN+afqNNjc9P8HPAbnpnc5s= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/bigquery/storage/apiv1/big_query_read_client.go b/bigquery/storage/apiv1/big_query_read_client.go index 30d7cdc5146..5b74ab9cfec 100644 --- a/bigquery/storage/apiv1/big_query_read_client.go +++ b/bigquery/storage/apiv1/big_query_read_client.go @@ -158,7 +158,7 @@ func (c *BigQueryReadClient) Connection() *grpc.ClientConn { // limits are enforced based on the number of pre-filtered rows, so some // filters can lead to lopsided assignments. // -// Read sessions automatically expire 24 hours after they are created and do +// Read sessions automatically expire 6 hours after they are created and do // not require manual clean-up by the caller. func (c *BigQueryReadClient) CreateReadSession(ctx context.Context, req *storagepb.CreateReadSessionRequest, opts ...gax.CallOption) (*storagepb.ReadSession, error) { return c.internalClient.CreateReadSession(ctx, req, opts...) diff --git a/bigquery/storage/apiv1/doc.go b/bigquery/storage/apiv1/doc.go index edf3e2f12fa..e8b6536ce82 100644 --- a/bigquery/storage/apiv1/doc.go +++ b/bigquery/storage/apiv1/doc.go @@ -82,7 +82,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210821" +const versionClient = "20210915" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/compute/apiv1/accelerator_types_client.go b/compute/apiv1/accelerator_types_client.go index fc862a45826..ff52e0937f6 100644 --- a/compute/apiv1/accelerator_types_client.go +++ b/compute/apiv1/accelerator_types_client.go @@ -302,7 +302,10 @@ func (c *acceleratorTypesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.AcceleratorType{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of accelerator types that are available to the specified project. diff --git a/compute/apiv1/addresses_client.go b/compute/apiv1/addresses_client.go index e96c0c87945..93696112189 100644 --- a/compute/apiv1/addresses_client.go +++ b/compute/apiv1/addresses_client.go @@ -321,7 +321,7 @@ func (c *addressesRESTClient) Delete(ctx context.Context, req *computepb.DeleteA rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -361,7 +361,10 @@ func (c *addressesRESTClient) Get(ctx context.Context, req *computepb.GetAddress unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Address{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an address resource in the specified project by using the data included in the request. @@ -413,7 +416,7 @@ func (c *addressesRESTClient) Insert(ctx context.Context, req *computepb.InsertA rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/autoscalers_client.go b/compute/apiv1/autoscalers_client.go index 277cc187056..0f45d34f39b 100644 --- a/compute/apiv1/autoscalers_client.go +++ b/compute/apiv1/autoscalers_client.go @@ -335,7 +335,7 @@ func (c *autoscalersRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -375,7 +375,10 @@ func (c *autoscalersRESTClient) Get(ctx context.Context, req *computepb.GetAutos unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Autoscaler{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an autoscaler in the specified project using the data included in the request. @@ -427,7 +430,7 @@ func (c *autoscalersRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -569,7 +572,7 @@ func (c *autoscalersRESTClient) Patch(ctx context.Context, req *computepb.PatchA rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -627,7 +630,7 @@ func (c *autoscalersRESTClient) Update(ctx context.Context, req *computepb.Updat rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/backend_buckets_client.go b/compute/apiv1/backend_buckets_client.go index 34e90fb4430..b703c3ae216 100644 --- a/compute/apiv1/backend_buckets_client.go +++ b/compute/apiv1/backend_buckets_client.go @@ -254,7 +254,7 @@ func (c *backendBucketsRESTClient) AddSignedUrlKey(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -302,7 +302,7 @@ func (c *backendBucketsRESTClient) Delete(ctx context.Context, req *computepb.De rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -353,7 +353,7 @@ func (c *backendBucketsRESTClient) DeleteSignedUrlKey(ctx context.Context, req * rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -393,7 +393,10 @@ func (c *backendBucketsRESTClient) Get(ctx context.Context, req *computepb.GetBa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.BackendBucket{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a BackendBucket resource in the specified project using the data included in the request. @@ -445,7 +448,7 @@ func (c *backendBucketsRESTClient) Insert(ctx context.Context, req *computepb.In rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -584,7 +587,7 @@ func (c *backendBucketsRESTClient) Patch(ctx context.Context, req *computepb.Pat rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -639,7 +642,7 @@ func (c *backendBucketsRESTClient) Update(ctx context.Context, req *computepb.Up rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/backend_services_client.go b/compute/apiv1/backend_services_client.go index 4f45cb7ac64..037c1bc3bc2 100644 --- a/compute/apiv1/backend_services_client.go +++ b/compute/apiv1/backend_services_client.go @@ -280,7 +280,7 @@ func (c *backendServicesRESTClient) AddSignedUrlKey(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -422,7 +422,7 @@ func (c *backendServicesRESTClient) Delete(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -473,7 +473,7 @@ func (c *backendServicesRESTClient) DeleteSignedUrlKey(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -513,7 +513,10 @@ func (c *backendServicesRESTClient) Get(ctx context.Context, req *computepb.GetB unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.BackendService{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetHealth gets the most recent health check results for this BackendService. @@ -561,7 +564,10 @@ func (c *backendServicesRESTClient) GetHealth(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.BackendServiceGroupHealth{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. @@ -613,7 +619,7 @@ func (c *backendServicesRESTClient) Insert(ctx context.Context, req *computepb.I rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -752,7 +758,7 @@ func (c *backendServicesRESTClient) Patch(ctx context.Context, req *computepb.Pa rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -807,7 +813,7 @@ func (c *backendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req * rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -862,7 +868,7 @@ func (c *backendServicesRESTClient) Update(ctx context.Context, req *computepb.U rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/disk_types_client.go b/compute/apiv1/disk_types_client.go index 6cda84826fa..53cc41557db 100644 --- a/compute/apiv1/disk_types_client.go +++ b/compute/apiv1/disk_types_client.go @@ -298,7 +298,10 @@ func (c *diskTypesRESTClient) Get(ctx context.Context, req *computepb.GetDiskTyp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DiskType{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of disk types available to the specified project. diff --git a/compute/apiv1/disks_client.go b/compute/apiv1/disks_client.go index 2067ce2ca3e..3447c405827 100644 --- a/compute/apiv1/disks_client.go +++ b/compute/apiv1/disks_client.go @@ -290,7 +290,7 @@ func (c *disksRESTClient) AddResourcePolicies(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -442,7 +442,7 @@ func (c *disksRESTClient) CreateSnapshot(ctx context.Context, req *computepb.Cre rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -490,7 +490,7 @@ func (c *disksRESTClient) Delete(ctx context.Context, req *computepb.DeleteDiskR rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -530,7 +530,10 @@ func (c *disksRESTClient) Get(ctx context.Context, req *computepb.GetDiskRequest unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Disk{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -574,7 +577,10 @@ func (c *disksRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a persistent disk in the specified project using the data in the request. You can create a disk from a source (sourceImage, sourceSnapshot, or sourceDisk) or create an empty 500 GB data disk by omitting all properties. You can also create a disk that is larger than the default size by specifying the sizeGb property. @@ -629,7 +635,7 @@ func (c *disksRESTClient) Insert(ctx context.Context, req *computepb.InsertDiskR rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -768,7 +774,7 @@ func (c *disksRESTClient) RemoveResourcePolicies(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -823,7 +829,7 @@ func (c *disksRESTClient) Resize(ctx context.Context, req *computepb.ResizeDiskR rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -870,7 +876,10 @@ func (c *disksRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetLabels sets the labels on a disk. To learn more about labels, read the Labeling Resources documentation. @@ -922,7 +931,7 @@ func (c *disksRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabel rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -969,7 +978,10 @@ func (c *disksRESTClient) TestIamPermissions(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // DiskIterator manages a stream of *computepb.Disk. diff --git a/compute/apiv1/doc.go b/compute/apiv1/doc.go index 3305dd3c71e..07294e778c0 100644 --- a/compute/apiv1/doc.go +++ b/compute/apiv1/doc.go @@ -17,7 +17,7 @@ // Package compute is an auto-generated package for the // Google Compute Engine API. // -// NOTE: This package is in alpha. It is not stable, and is likely to change. +// NOTE: This package is in beta. It is not stable, and may be subject to changes. // // Example usage // @@ -81,7 +81,7 @@ import ( "strings" "unicode" - _ "golang.org/x/xerrors" + "golang.org/x/xerrors" "google.golang.org/api/option" "google.golang.org/grpc/metadata" ) @@ -91,7 +91,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210821" +const versionClient = "20210915" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) @@ -159,3 +159,12 @@ func versionGo() string { } return "UNKNOWN" } + +// maybeUnknownEnum wraps the given proto-JSON parsing error if it is the result +// of receiving an unknown enum value. +func maybeUnknownEnum(err error) error { + if strings.Contains(err.Error(), "invalid value for enum type") { + err = xerrors.Errorf("received an unknown enum value; a later version of the library may support it: %w", err) + } + return err +} diff --git a/compute/apiv1/external_vpn_gateways_client.go b/compute/apiv1/external_vpn_gateways_client.go index d01d7946502..fcdc013c82c 100644 --- a/compute/apiv1/external_vpn_gateways_client.go +++ b/compute/apiv1/external_vpn_gateways_client.go @@ -233,7 +233,7 @@ func (c *externalVpnGatewaysRESTClient) Delete(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *externalVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.ExternalVpnGateway{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a ExternalVpnGateway in the specified project using the data included in the request. @@ -325,7 +328,7 @@ func (c *externalVpnGatewaysRESTClient) Insert(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *externalVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -504,7 +507,10 @@ func (c *externalVpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // ExternalVpnGatewayIterator manages a stream of *computepb.ExternalVpnGateway. diff --git a/compute/apiv1/firewall_policies_client.go b/compute/apiv1/firewall_policies_client.go index b0727e53676..abf640d0902 100644 --- a/compute/apiv1/firewall_policies_client.go +++ b/compute/apiv1/firewall_policies_client.go @@ -327,7 +327,7 @@ func (c *firewallPoliciesRESTClient) AddAssociation(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -382,7 +382,7 @@ func (c *firewallPoliciesRESTClient) AddRule(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -433,7 +433,7 @@ func (c *firewallPoliciesRESTClient) CloneRules(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -481,7 +481,7 @@ func (c *firewallPoliciesRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -521,7 +521,10 @@ func (c *firewallPoliciesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.FirewallPolicy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetAssociation gets an association with the specified name. @@ -565,7 +568,10 @@ func (c *firewallPoliciesRESTClient) GetAssociation(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.FirewallPolicyAssociation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -609,7 +615,10 @@ func (c *firewallPoliciesRESTClient) GetIamPolicy(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetRule gets a rule of the specified priority. @@ -653,7 +662,10 @@ func (c *firewallPoliciesRESTClient) GetRule(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.FirewallPolicyRule{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a new policy in the specified project using the data included in the request. @@ -708,7 +720,7 @@ func (c *firewallPoliciesRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -842,7 +854,10 @@ func (c *firewallPoliciesRESTClient) ListAssociations(ctx context.Context, req * unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.FirewallPoliciesListAssociationsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Move moves the specified firewall policy. @@ -890,7 +905,7 @@ func (c *firewallPoliciesRESTClient) Move(ctx context.Context, req *computepb.Mo rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -945,7 +960,7 @@ func (c *firewallPoliciesRESTClient) Patch(ctx context.Context, req *computepb.P rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1003,7 +1018,7 @@ func (c *firewallPoliciesRESTClient) PatchRule(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1054,7 +1069,7 @@ func (c *firewallPoliciesRESTClient) RemoveAssociation(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1105,7 +1120,7 @@ func (c *firewallPoliciesRESTClient) RemoveRule(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1152,7 +1167,10 @@ func (c *firewallPoliciesRESTClient) SetIamPolicy(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. @@ -1196,7 +1214,10 @@ func (c *firewallPoliciesRESTClient) TestIamPermissions(ctx context.Context, req unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // FirewallPolicyIterator manages a stream of *computepb.FirewallPolicy. diff --git a/compute/apiv1/firewalls_client.go b/compute/apiv1/firewalls_client.go index ea284ea929a..7eac9a3493e 100644 --- a/compute/apiv1/firewalls_client.go +++ b/compute/apiv1/firewalls_client.go @@ -233,7 +233,7 @@ func (c *firewallsRESTClient) Delete(ctx context.Context, req *computepb.DeleteF rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *firewallsRESTClient) Get(ctx context.Context, req *computepb.GetFirewal unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Firewall{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a firewall rule in the specified project using the data included in the request. @@ -325,7 +328,7 @@ func (c *firewallsRESTClient) Insert(ctx context.Context, req *computepb.InsertF rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -464,7 +467,7 @@ func (c *firewallsRESTClient) Patch(ctx context.Context, req *computepb.PatchFir rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -519,7 +522,7 @@ func (c *firewallsRESTClient) Update(ctx context.Context, req *computepb.UpdateF rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/forwarding_rules_client.go b/compute/apiv1/forwarding_rules_client.go index c16cb3100b4..229e83dfb2d 100644 --- a/compute/apiv1/forwarding_rules_client.go +++ b/compute/apiv1/forwarding_rules_client.go @@ -342,7 +342,7 @@ func (c *forwardingRulesRESTClient) Delete(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -382,7 +382,10 @@ func (c *forwardingRulesRESTClient) Get(ctx context.Context, req *computepb.GetF unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.ForwardingRule{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a ForwardingRule resource in the specified project and region using the data included in the request. @@ -434,7 +437,7 @@ func (c *forwardingRulesRESTClient) Insert(ctx context.Context, req *computepb.I rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -573,7 +576,7 @@ func (c *forwardingRulesRESTClient) Patch(ctx context.Context, req *computepb.Pa rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -628,7 +631,7 @@ func (c *forwardingRulesRESTClient) SetLabels(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -683,7 +686,7 @@ func (c *forwardingRulesRESTClient) SetTarget(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/global_addresses_client.go b/compute/apiv1/global_addresses_client.go index 29e15b9de95..e3f383a2aa7 100644 --- a/compute/apiv1/global_addresses_client.go +++ b/compute/apiv1/global_addresses_client.go @@ -219,7 +219,7 @@ func (c *globalAddressesRESTClient) Delete(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -259,7 +259,10 @@ func (c *globalAddressesRESTClient) Get(ctx context.Context, req *computepb.GetG unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Address{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an address resource in the specified project by using the data included in the request. @@ -311,7 +314,7 @@ func (c *globalAddressesRESTClient) Insert(ctx context.Context, req *computepb.I rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/global_forwarding_rules_client.go b/compute/apiv1/global_forwarding_rules_client.go index 5d6d0477abf..22aea9b76a5 100644 --- a/compute/apiv1/global_forwarding_rules_client.go +++ b/compute/apiv1/global_forwarding_rules_client.go @@ -240,7 +240,7 @@ func (c *globalForwardingRulesRESTClient) Delete(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -280,7 +280,10 @@ func (c *globalForwardingRulesRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.ForwardingRule{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a GlobalForwardingRule resource in the specified project using the data included in the request. @@ -332,7 +335,7 @@ func (c *globalForwardingRulesRESTClient) Insert(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -471,7 +474,7 @@ func (c *globalForwardingRulesRESTClient) Patch(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -519,7 +522,7 @@ func (c *globalForwardingRulesRESTClient) SetLabels(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -574,7 +577,7 @@ func (c *globalForwardingRulesRESTClient) SetTarget(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/global_network_endpoint_groups_client.go b/compute/apiv1/global_network_endpoint_groups_client.go index 81e08afa78d..5005f6b45dc 100644 --- a/compute/apiv1/global_network_endpoint_groups_client.go +++ b/compute/apiv1/global_network_endpoint_groups_client.go @@ -247,7 +247,7 @@ func (c *globalNetworkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx conte rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -295,7 +295,7 @@ func (c *globalNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -350,7 +350,7 @@ func (c *globalNetworkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx conte rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -390,7 +390,10 @@ func (c *globalNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NetworkEndpointGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a network endpoint group in the specified project using the parameters that are included in the request. @@ -442,7 +445,7 @@ func (c *globalNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/global_operations_client.go b/compute/apiv1/global_operations_client.go index be70a496b7f..74a314bcb7d 100644 --- a/compute/apiv1/global_operations_client.go +++ b/compute/apiv1/global_operations_client.go @@ -318,7 +318,10 @@ func (c *globalOperationsRESTClient) Delete(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DeleteGlobalOperationResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. @@ -355,7 +358,10 @@ func (c *globalOperationsRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of Operation resources contained within the specified project. @@ -482,7 +488,10 @@ func (c *globalOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // OperationIterator manages a stream of *computepb.Operation. diff --git a/compute/apiv1/global_organization_operations_client.go b/compute/apiv1/global_organization_operations_client.go index 12ab2c45216..be663e6317e 100644 --- a/compute/apiv1/global_organization_operations_client.go +++ b/compute/apiv1/global_organization_operations_client.go @@ -210,7 +210,10 @@ func (c *globalOrganizationOperationsRESTClient) Delete(ctx context.Context, req unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DeleteGlobalOrganizationOperationResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Get retrieves the specified Operations resource. Gets a list of operations by making a list() request. @@ -254,7 +257,10 @@ func (c *globalOrganizationOperationsRESTClient) Get(ctx context.Context, req *c unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of Operation resources contained within the specified organization. diff --git a/compute/apiv1/global_public_delegated_prefixes_client.go b/compute/apiv1/global_public_delegated_prefixes_client.go index 36dd8ff0407..0b1480ab11d 100644 --- a/compute/apiv1/global_public_delegated_prefixes_client.go +++ b/compute/apiv1/global_public_delegated_prefixes_client.go @@ -226,7 +226,7 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Delete(ctx context.Context, re rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -266,7 +266,10 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Get(ctx context.Context, req * unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.PublicDelegatedPrefix{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a global PublicDelegatedPrefix in the specified project using the parameters that are included in the request. @@ -318,7 +321,7 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Insert(ctx context.Context, re rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/health_checks_client.go b/compute/apiv1/health_checks_client.go index 1552f55c874..310dca05aee 100644 --- a/compute/apiv1/health_checks_client.go +++ b/compute/apiv1/health_checks_client.go @@ -335,7 +335,7 @@ func (c *healthChecksRESTClient) Delete(ctx context.Context, req *computepb.Dele rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -375,7 +375,10 @@ func (c *healthChecksRESTClient) Get(ctx context.Context, req *computepb.GetHeal unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.HealthCheck{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a HealthCheck resource in the specified project using the data included in the request. @@ -427,7 +430,7 @@ func (c *healthChecksRESTClient) Insert(ctx context.Context, req *computepb.Inse rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -566,7 +569,7 @@ func (c *healthChecksRESTClient) Patch(ctx context.Context, req *computepb.Patch rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -621,7 +624,7 @@ func (c *healthChecksRESTClient) Update(ctx context.Context, req *computepb.Upda rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/images_client.go b/compute/apiv1/images_client.go index 1c8a92d3cdf..abf5a97449f 100644 --- a/compute/apiv1/images_client.go +++ b/compute/apiv1/images_client.go @@ -270,7 +270,7 @@ func (c *imagesRESTClient) Delete(ctx context.Context, req *computepb.DeleteImag rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -327,7 +327,7 @@ func (c *imagesRESTClient) Deprecate(ctx context.Context, req *computepb.Depreca rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -367,7 +367,10 @@ func (c *imagesRESTClient) Get(ctx context.Context, req *computepb.GetImageReque unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Image{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetFromFamily returns the latest image that is part of an image family and is not deprecated. @@ -404,7 +407,10 @@ func (c *imagesRESTClient) GetFromFamily(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Image{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -448,7 +454,10 @@ func (c *imagesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetI unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an image in the specified project using the data included in the request. @@ -503,7 +512,7 @@ func (c *imagesRESTClient) Insert(ctx context.Context, req *computepb.InsertImag rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -642,7 +651,7 @@ func (c *imagesRESTClient) Patch(ctx context.Context, req *computepb.PatchImageR rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -689,7 +698,10 @@ func (c *imagesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetI unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetLabels sets the labels on an image. To learn more about labels, read the Labeling Resources documentation. @@ -734,7 +746,7 @@ func (c *imagesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabe rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -781,7 +793,10 @@ func (c *imagesRESTClient) TestIamPermissions(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // ImageIterator manages a stream of *computepb.Image. diff --git a/compute/apiv1/instance_group_managers_client.go b/compute/apiv1/instance_group_managers_client.go index c4ee7c9fe30..051f90040f6 100644 --- a/compute/apiv1/instance_group_managers_client.go +++ b/compute/apiv1/instance_group_managers_client.go @@ -365,7 +365,7 @@ func (c *instanceGroupManagersRESTClient) AbandonInstances(ctx context.Context, rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -507,7 +507,7 @@ func (c *instanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx context.Co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -562,7 +562,7 @@ func (c *instanceGroupManagersRESTClient) CreateInstances(ctx context.Context, r rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -610,7 +610,7 @@ func (c *instanceGroupManagersRESTClient) Delete(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -669,7 +669,7 @@ func (c *instanceGroupManagersRESTClient) DeleteInstances(ctx context.Context, r rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -717,7 +717,7 @@ func (c *instanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.C rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -757,7 +757,10 @@ func (c *instanceGroupManagersRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstanceGroupManager{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. @@ -811,7 +814,7 @@ func (c *instanceGroupManagersRESTClient) Insert(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1202,7 +1205,7 @@ func (c *instanceGroupManagersRESTClient) Patch(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1257,7 +1260,7 @@ func (c *instanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1316,7 +1319,7 @@ func (c *instanceGroupManagersRESTClient) RecreateInstances(ctx context.Context, rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1375,7 +1378,7 @@ func (c *instanceGroupManagersRESTClient) Resize(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1430,7 +1433,7 @@ func (c *instanceGroupManagersRESTClient) SetInstanceTemplate(ctx context.Contex rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1485,7 +1488,7 @@ func (c *instanceGroupManagersRESTClient) SetTargetPools(ctx context.Context, re rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1540,7 +1543,7 @@ func (c *instanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.C rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/instance_groups_client.go b/compute/apiv1/instance_groups_client.go index a66fc53cde3..a4817890e87 100644 --- a/compute/apiv1/instance_groups_client.go +++ b/compute/apiv1/instance_groups_client.go @@ -268,7 +268,7 @@ func (c *instanceGroupsRESTClient) AddInstances(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -410,7 +410,7 @@ func (c *instanceGroupsRESTClient) Delete(ctx context.Context, req *computepb.De rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -452,7 +452,10 @@ func (c *instanceGroupsRESTClient) Get(ctx context.Context, req *computepb.GetIn unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstanceGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an instance group in the specified project using the parameters that are included in the request. @@ -504,7 +507,7 @@ func (c *instanceGroupsRESTClient) Insert(ctx context.Context, req *computepb.In rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -737,7 +740,7 @@ func (c *instanceGroupsRESTClient) RemoveInstances(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -792,7 +795,7 @@ func (c *instanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/instance_templates_client.go b/compute/apiv1/instance_templates_client.go index 1d1c5f75f88..6293b82a0b1 100644 --- a/compute/apiv1/instance_templates_client.go +++ b/compute/apiv1/instance_templates_client.go @@ -240,7 +240,7 @@ func (c *instanceTemplatesRESTClient) Delete(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -280,7 +280,10 @@ func (c *instanceTemplatesRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstanceTemplate{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -324,7 +327,10 @@ func (c *instanceTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an instance template in the specified project using the data that is included in the request. If you are creating a new template to update an existing instance group, your new instance template must use the same network or, if applicable, the same subnetwork as the original template. @@ -376,7 +382,7 @@ func (c *instanceTemplatesRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -507,7 +513,10 @@ func (c *instanceTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. @@ -551,7 +560,10 @@ func (c *instanceTemplatesRESTClient) TestIamPermissions(ctx context.Context, re unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // InstanceTemplateIterator manages a stream of *computepb.InstanceTemplate. diff --git a/compute/apiv1/instances_client.go b/compute/apiv1/instances_client.go index de8ebebbfb8..7d8decc075c 100644 --- a/compute/apiv1/instances_client.go +++ b/compute/apiv1/instances_client.go @@ -496,7 +496,7 @@ func (c *instancesRESTClient) AddAccessConfig(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -551,7 +551,7 @@ func (c *instancesRESTClient) AddResourcePolicies(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -703,7 +703,7 @@ func (c *instancesRESTClient) AttachDisk(ctx context.Context, req *computepb.Att rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -758,7 +758,7 @@ func (c *instancesRESTClient) BulkInsert(ctx context.Context, req *computepb.Bul rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -806,7 +806,7 @@ func (c *instancesRESTClient) Delete(ctx context.Context, req *computepb.DeleteI rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -860,7 +860,7 @@ func (c *instancesRESTClient) DeleteAccessConfig(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -911,7 +911,7 @@ func (c *instancesRESTClient) DetachDisk(ctx context.Context, req *computepb.Det rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -951,7 +951,10 @@ func (c *instancesRESTClient) Get(ctx context.Context, req *computepb.GetInstanc unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Instance{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetEffectiveFirewalls returns effective firewalls applied to an interface of the instance. @@ -995,7 +998,10 @@ func (c *instancesRESTClient) GetEffectiveFirewalls(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstancesGetEffectiveFirewallsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetGuestAttributes returns the specified guest attributes entry. @@ -1042,7 +1048,10 @@ func (c *instancesRESTClient) GetGuestAttributes(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.GuestAttributes{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -1086,7 +1095,10 @@ func (c *instancesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.G unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetScreenshot returns the screenshot from the specified instance. @@ -1123,7 +1135,10 @@ func (c *instancesRESTClient) GetScreenshot(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Screenshot{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetSerialPortOutput returns the last 1 MB of serial port output from the specified instance. @@ -1170,7 +1185,10 @@ func (c *instancesRESTClient) GetSerialPortOutput(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SerialPortOutput{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetShieldedInstanceIdentity returns the Shielded Instance Identity of an instance @@ -1207,7 +1225,10 @@ func (c *instancesRESTClient) GetShieldedInstanceIdentity(ctx context.Context, r unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.ShieldedInstanceIdentity{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an instance resource in the specified project using the data included in the request. @@ -1262,7 +1283,7 @@ func (c *instancesRESTClient) Insert(ctx context.Context, req *computepb.InsertI rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1485,7 +1506,7 @@ func (c *instancesRESTClient) RemoveResourcePolicies(ctx context.Context, req *c rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1533,7 +1554,7 @@ func (c *instancesRESTClient) Reset(ctx context.Context, req *computepb.ResetIns rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1584,7 +1605,7 @@ func (c *instancesRESTClient) SetDeletionProtection(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1638,7 +1659,7 @@ func (c *instancesRESTClient) SetDiskAutoDelete(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1685,7 +1706,10 @@ func (c *instancesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.S unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetLabels sets labels on an instance. To learn more about labels, read the Labeling Resources documentation. @@ -1737,7 +1761,7 @@ func (c *instancesRESTClient) SetLabels(ctx context.Context, req *computepb.SetL rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1792,7 +1816,7 @@ func (c *instancesRESTClient) SetMachineResources(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1847,7 +1871,7 @@ func (c *instancesRESTClient) SetMachineType(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1902,7 +1926,7 @@ func (c *instancesRESTClient) SetMetadata(ctx context.Context, req *computepb.Se rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1957,7 +1981,7 @@ func (c *instancesRESTClient) SetMinCpuPlatform(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2012,7 +2036,7 @@ func (c *instancesRESTClient) SetScheduling(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2067,7 +2091,7 @@ func (c *instancesRESTClient) SetServiceAccount(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2122,7 +2146,7 @@ func (c *instancesRESTClient) SetShieldedInstanceIntegrityPolicy(ctx context.Con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2177,7 +2201,7 @@ func (c *instancesRESTClient) SetTags(ctx context.Context, req *computepb.SetTag rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2218,7 +2242,7 @@ func (c *instancesRESTClient) SimulateMaintenanceEvent(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2266,7 +2290,7 @@ func (c *instancesRESTClient) Start(ctx context.Context, req *computepb.StartIns rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2321,7 +2345,7 @@ func (c *instancesRESTClient) StartWithEncryptionKey(ctx context.Context, req *c rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2369,7 +2393,7 @@ func (c *instancesRESTClient) Stop(ctx context.Context, req *computepb.StopInsta rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2416,7 +2440,10 @@ func (c *instancesRESTClient) TestIamPermissions(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Update updates an instance only if the necessary resources are available. This method can update only a specific set of instance properties. See Updating a running instance for a list of updatable instance properties. @@ -2474,7 +2501,7 @@ func (c *instancesRESTClient) Update(ctx context.Context, req *computepb.UpdateI rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2532,7 +2559,7 @@ func (c *instancesRESTClient) UpdateAccessConfig(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2587,7 +2614,7 @@ func (c *instancesRESTClient) UpdateDisplayDevice(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2645,7 +2672,7 @@ func (c *instancesRESTClient) UpdateNetworkInterface(ctx context.Context, req *c rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -2700,7 +2727,7 @@ func (c *instancesRESTClient) UpdateShieldedInstanceConfig(ctx context.Context, rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/interconnect_attachments_client.go b/compute/apiv1/interconnect_attachments_client.go index 8c9806769d6..3bcd6f1666a 100644 --- a/compute/apiv1/interconnect_attachments_client.go +++ b/compute/apiv1/interconnect_attachments_client.go @@ -328,7 +328,7 @@ func (c *interconnectAttachmentsRESTClient) Delete(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -368,7 +368,10 @@ func (c *interconnectAttachmentsRESTClient) Get(ctx context.Context, req *comput unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InterconnectAttachment{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an InterconnectAttachment in the specified project using the data included in the request. @@ -423,7 +426,7 @@ func (c *interconnectAttachmentsRESTClient) Insert(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -562,7 +565,7 @@ func (c *interconnectAttachmentsRESTClient) Patch(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/interconnect_locations_client.go b/compute/apiv1/interconnect_locations_client.go index ade12440850..719e4708bed 100644 --- a/compute/apiv1/interconnect_locations_client.go +++ b/compute/apiv1/interconnect_locations_client.go @@ -196,7 +196,10 @@ func (c *interconnectLocationsRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InterconnectLocation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves the list of interconnect locations available to the specified project. diff --git a/compute/apiv1/interconnects_client.go b/compute/apiv1/interconnects_client.go index f930c9f89b4..4a23f256dff 100644 --- a/compute/apiv1/interconnects_client.go +++ b/compute/apiv1/interconnects_client.go @@ -233,7 +233,7 @@ func (c *interconnectsRESTClient) Delete(ctx context.Context, req *computepb.Del rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *interconnectsRESTClient) Get(ctx context.Context, req *computepb.GetInt unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Interconnect{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetDiagnostics returns the interconnectDiagnostics for the specified interconnect. @@ -310,7 +313,10 @@ func (c *interconnectsRESTClient) GetDiagnostics(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InterconnectsGetDiagnosticsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a Interconnect in the specified project using the data included in the request. @@ -362,7 +368,7 @@ func (c *interconnectsRESTClient) Insert(ctx context.Context, req *computepb.Ins rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -501,7 +507,7 @@ func (c *interconnectsRESTClient) Patch(ctx context.Context, req *computepb.Patc rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/license_codes_client.go b/compute/apiv1/license_codes_client.go index e032c06fb12..f41935f75b8 100644 --- a/compute/apiv1/license_codes_client.go +++ b/compute/apiv1/license_codes_client.go @@ -194,7 +194,10 @@ func (c *licenseCodesRESTClient) Get(ctx context.Context, req *computepb.GetLice unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.LicenseCode{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -238,5 +241,8 @@ func (c *licenseCodesRESTClient) TestIamPermissions(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } diff --git a/compute/apiv1/licenses_client.go b/compute/apiv1/licenses_client.go index feeb019eeea..43117b30f24 100644 --- a/compute/apiv1/licenses_client.go +++ b/compute/apiv1/licenses_client.go @@ -240,7 +240,7 @@ func (c *licensesRESTClient) Delete(ctx context.Context, req *computepb.DeleteLi rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -280,7 +280,10 @@ func (c *licensesRESTClient) Get(ctx context.Context, req *computepb.GetLicenseR unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.License{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -324,7 +327,10 @@ func (c *licensesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert create a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -376,7 +382,7 @@ func (c *licensesRESTClient) Insert(ctx context.Context, req *computepb.InsertLi rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -507,7 +513,10 @@ func (c *licensesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.Se unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images. @@ -551,7 +560,10 @@ func (c *licensesRESTClient) TestIamPermissions(ctx context.Context, req *comput unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // LicenseIterator manages a stream of *computepb.License. diff --git a/compute/apiv1/machine_types_client.go b/compute/apiv1/machine_types_client.go index f5301d5b809..0f8a8abe814 100644 --- a/compute/apiv1/machine_types_client.go +++ b/compute/apiv1/machine_types_client.go @@ -298,7 +298,10 @@ func (c *machineTypesRESTClient) Get(ctx context.Context, req *computepb.GetMach unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.MachineType{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of machine types available to the specified project. diff --git a/compute/apiv1/network_endpoint_groups_client.go b/compute/apiv1/network_endpoint_groups_client.go index bd88941b5d6..a692de382be 100644 --- a/compute/apiv1/network_endpoint_groups_client.go +++ b/compute/apiv1/network_endpoint_groups_client.go @@ -356,7 +356,7 @@ func (c *networkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx context.Con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -404,7 +404,7 @@ func (c *networkEndpointGroupsRESTClient) Delete(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -459,7 +459,7 @@ func (c *networkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx context.Con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -499,7 +499,10 @@ func (c *networkEndpointGroupsRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NetworkEndpointGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a network endpoint group in the specified project using the parameters that are included in the request. @@ -551,7 +554,7 @@ func (c *networkEndpointGroupsRESTClient) Insert(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -772,7 +775,10 @@ func (c *networkEndpointGroupsRESTClient) TestIamPermissions(ctx context.Context unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // NetworkEndpointGroupsScopedListPair is a holder type for string/*computepb.NetworkEndpointGroupsScopedList map entries diff --git a/compute/apiv1/networks_client.go b/compute/apiv1/networks_client.go index c8a7ba417e9..38dc9109158 100644 --- a/compute/apiv1/networks_client.go +++ b/compute/apiv1/networks_client.go @@ -275,7 +275,7 @@ func (c *networksRESTClient) AddPeering(ctx context.Context, req *computepb.AddP rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -323,7 +323,7 @@ func (c *networksRESTClient) Delete(ctx context.Context, req *computepb.DeleteNe rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -363,7 +363,10 @@ func (c *networksRESTClient) Get(ctx context.Context, req *computepb.GetNetworkR unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Network{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetEffectiveFirewalls returns the effective firewalls on a given network. @@ -400,7 +403,10 @@ func (c *networksRESTClient) GetEffectiveFirewalls(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NetworksGetEffectiveFirewallsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a network in the specified project using the data included in the request. @@ -452,7 +458,7 @@ func (c *networksRESTClient) Insert(ctx context.Context, req *computepb.InsertNe rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -684,7 +690,7 @@ func (c *networksRESTClient) Patch(ctx context.Context, req *computepb.PatchNetw rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -739,7 +745,7 @@ func (c *networksRESTClient) RemovePeering(ctx context.Context, req *computepb.R rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -787,7 +793,7 @@ func (c *networksRESTClient) SwitchToCustomMode(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -842,7 +848,7 @@ func (c *networksRESTClient) UpdatePeering(ctx context.Context, req *computepb.U rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/node_groups_client.go b/compute/apiv1/node_groups_client.go index e24f984f05d..9b902ef43c7 100644 --- a/compute/apiv1/node_groups_client.go +++ b/compute/apiv1/node_groups_client.go @@ -290,7 +290,7 @@ func (c *nodeGroupsRESTClient) AddNodes(ctx context.Context, req *computepb.AddN rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -432,7 +432,7 @@ func (c *nodeGroupsRESTClient) Delete(ctx context.Context, req *computepb.Delete rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -487,7 +487,7 @@ func (c *nodeGroupsRESTClient) DeleteNodes(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -527,7 +527,10 @@ func (c *nodeGroupsRESTClient) Get(ctx context.Context, req *computepb.GetNodeGr unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NodeGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -571,7 +574,10 @@ func (c *nodeGroupsRESTClient) GetIamPolicy(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a NodeGroup resource in the specified project using the data included in the request. @@ -626,7 +632,7 @@ func (c *nodeGroupsRESTClient) Insert(ctx context.Context, req *computepb.Insert rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -849,7 +855,7 @@ func (c *nodeGroupsRESTClient) Patch(ctx context.Context, req *computepb.PatchNo rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -896,7 +902,10 @@ func (c *nodeGroupsRESTClient) SetIamPolicy(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetNodeTemplate updates the node template of the node group. @@ -948,7 +957,7 @@ func (c *nodeGroupsRESTClient) SetNodeTemplate(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -995,7 +1004,10 @@ func (c *nodeGroupsRESTClient) TestIamPermissions(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // NodeGroupIterator manages a stream of *computepb.NodeGroup. diff --git a/compute/apiv1/node_templates_client.go b/compute/apiv1/node_templates_client.go index 88098771efb..7e22664d6ed 100644 --- a/compute/apiv1/node_templates_client.go +++ b/compute/apiv1/node_templates_client.go @@ -342,7 +342,7 @@ func (c *nodeTemplatesRESTClient) Delete(ctx context.Context, req *computepb.Del rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -382,7 +382,10 @@ func (c *nodeTemplatesRESTClient) Get(ctx context.Context, req *computepb.GetNod unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NodeTemplate{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -426,7 +429,10 @@ func (c *nodeTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *compute unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a NodeTemplate resource in the specified project using the data included in the request. @@ -478,7 +484,7 @@ func (c *nodeTemplatesRESTClient) Insert(ctx context.Context, req *computepb.Ins rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -609,7 +615,10 @@ func (c *nodeTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *compute unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. @@ -653,7 +662,10 @@ func (c *nodeTemplatesRESTClient) TestIamPermissions(ctx context.Context, req *c unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // NodeTemplateIterator manages a stream of *computepb.NodeTemplate. diff --git a/compute/apiv1/node_types_client.go b/compute/apiv1/node_types_client.go index c40f3ec4be4..5b6f210dc6e 100644 --- a/compute/apiv1/node_types_client.go +++ b/compute/apiv1/node_types_client.go @@ -298,7 +298,10 @@ func (c *nodeTypesRESTClient) Get(ctx context.Context, req *computepb.GetNodeTyp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NodeType{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of node types available to the specified project. diff --git a/compute/apiv1/packet_mirrorings_client.go b/compute/apiv1/packet_mirrorings_client.go index 8861cb702ad..a7b44847662 100644 --- a/compute/apiv1/packet_mirrorings_client.go +++ b/compute/apiv1/packet_mirrorings_client.go @@ -335,7 +335,7 @@ func (c *packetMirroringsRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -375,7 +375,10 @@ func (c *packetMirroringsRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.PacketMirroring{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a PacketMirroring resource in the specified project and region using the data included in the request. @@ -427,7 +430,7 @@ func (c *packetMirroringsRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -566,7 +569,7 @@ func (c *packetMirroringsRESTClient) Patch(ctx context.Context, req *computepb.P rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -613,7 +616,10 @@ func (c *packetMirroringsRESTClient) TestIamPermissions(ctx context.Context, req unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // PacketMirroringIterator manages a stream of *computepb.PacketMirroring. diff --git a/compute/apiv1/projects_client.go b/compute/apiv1/projects_client.go index 8d3e7eb195d..d1422ef8d4e 100644 --- a/compute/apiv1/projects_client.go +++ b/compute/apiv1/projects_client.go @@ -282,7 +282,7 @@ func (c *projectsRESTClient) DisableXpnHost(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -337,7 +337,7 @@ func (c *projectsRESTClient) DisableXpnResource(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -385,7 +385,7 @@ func (c *projectsRESTClient) EnableXpnHost(ctx context.Context, req *computepb.E rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -440,7 +440,7 @@ func (c *projectsRESTClient) EnableXpnResource(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -480,7 +480,10 @@ func (c *projectsRESTClient) Get(ctx context.Context, req *computepb.GetProjectR unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Project{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetXpnHost gets the shared VPC host project that this project links to. May be empty if no link exists. @@ -517,7 +520,10 @@ func (c *projectsRESTClient) GetXpnHost(ctx context.Context, req *computepb.GetX unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Project{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetXpnResources gets service resources (a.k.a service project) associated with this host project. @@ -743,7 +749,7 @@ func (c *projectsRESTClient) MoveDisk(ctx context.Context, req *computepb.MoveDi rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -798,7 +804,7 @@ func (c *projectsRESTClient) MoveInstance(ctx context.Context, req *computepb.Mo rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -853,7 +859,7 @@ func (c *projectsRESTClient) SetCommonInstanceMetadata(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -908,7 +914,7 @@ func (c *projectsRESTClient) SetDefaultNetworkTier(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -963,7 +969,7 @@ func (c *projectsRESTClient) SetUsageExportBucket(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/public_advertised_prefixes_client.go b/compute/apiv1/public_advertised_prefixes_client.go index c5b7c0e0bef..6126550804e 100644 --- a/compute/apiv1/public_advertised_prefixes_client.go +++ b/compute/apiv1/public_advertised_prefixes_client.go @@ -226,7 +226,7 @@ func (c *publicAdvertisedPrefixesRESTClient) Delete(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -266,7 +266,10 @@ func (c *publicAdvertisedPrefixesRESTClient) Get(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.PublicAdvertisedPrefix{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a PublicAdvertisedPrefix in the specified project using the parameters that are included in the request. @@ -318,7 +321,7 @@ func (c *publicAdvertisedPrefixesRESTClient) Insert(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *publicAdvertisedPrefixesRESTClient) Patch(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/public_delegated_prefixes_client.go b/compute/apiv1/public_delegated_prefixes_client.go index 5c1f63cef0c..1a00116be5b 100644 --- a/compute/apiv1/public_delegated_prefixes_client.go +++ b/compute/apiv1/public_delegated_prefixes_client.go @@ -328,7 +328,7 @@ func (c *publicDelegatedPrefixesRESTClient) Delete(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -368,7 +368,10 @@ func (c *publicDelegatedPrefixesRESTClient) Get(ctx context.Context, req *comput unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.PublicDelegatedPrefix{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a PublicDelegatedPrefix in the specified project in the given region using the parameters that are included in the request. @@ -420,7 +423,7 @@ func (c *publicDelegatedPrefixesRESTClient) Insert(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -559,7 +562,7 @@ func (c *publicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_autoscalers_client.go b/compute/apiv1/region_autoscalers_client.go index 742a4a80617..230c5291937 100644 --- a/compute/apiv1/region_autoscalers_client.go +++ b/compute/apiv1/region_autoscalers_client.go @@ -233,7 +233,7 @@ func (c *regionAutoscalersRESTClient) Delete(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *regionAutoscalersRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Autoscaler{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates an autoscaler in the specified project using the data included in the request. @@ -325,7 +328,7 @@ func (c *regionAutoscalersRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -467,7 +470,7 @@ func (c *regionAutoscalersRESTClient) Patch(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -525,7 +528,7 @@ func (c *regionAutoscalersRESTClient) Update(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_backend_services_client.go b/compute/apiv1/region_backend_services_client.go index 7de158b7912..0d7435659f6 100644 --- a/compute/apiv1/region_backend_services_client.go +++ b/compute/apiv1/region_backend_services_client.go @@ -240,7 +240,7 @@ func (c *regionBackendServicesRESTClient) Delete(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -280,7 +280,10 @@ func (c *regionBackendServicesRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.BackendService{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetHealth gets the most recent health check results for this regional BackendService. @@ -324,7 +327,10 @@ func (c *regionBackendServicesRESTClient) GetHealth(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.BackendServiceGroupHealth{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. @@ -376,7 +382,7 @@ func (c *regionBackendServicesRESTClient) Insert(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -515,7 +521,7 @@ func (c *regionBackendServicesRESTClient) Patch(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -570,7 +576,7 @@ func (c *regionBackendServicesRESTClient) Update(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_commitments_client.go b/compute/apiv1/region_commitments_client.go index 92f6ab3b904..d34298da1b5 100644 --- a/compute/apiv1/region_commitments_client.go +++ b/compute/apiv1/region_commitments_client.go @@ -306,7 +306,10 @@ func (c *regionCommitmentsRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Commitment{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a commitment in the specified project using the data included in the request. @@ -358,7 +361,7 @@ func (c *regionCommitmentsRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_disk_types_client.go b/compute/apiv1/region_disk_types_client.go index 86fb7eb787b..6e5dd732cd2 100644 --- a/compute/apiv1/region_disk_types_client.go +++ b/compute/apiv1/region_disk_types_client.go @@ -196,7 +196,10 @@ func (c *regionDiskTypesRESTClient) Get(ctx context.Context, req *computepb.GetR unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DiskType{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of regional disk types available to the specified project. diff --git a/compute/apiv1/region_disks_client.go b/compute/apiv1/region_disks_client.go index f0059202eb6..0d9fed5983f 100644 --- a/compute/apiv1/region_disks_client.go +++ b/compute/apiv1/region_disks_client.go @@ -282,7 +282,7 @@ func (c *regionDisksRESTClient) AddResourcePolicies(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -337,7 +337,7 @@ func (c *regionDisksRESTClient) CreateSnapshot(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -385,7 +385,7 @@ func (c *regionDisksRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -425,7 +425,10 @@ func (c *regionDisksRESTClient) Get(ctx context.Context, req *computepb.GetRegio unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Disk{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -469,7 +472,10 @@ func (c *regionDisksRESTClient) GetIamPolicy(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a persistent regional disk in the specified project using the data included in the request. @@ -524,7 +530,7 @@ func (c *regionDisksRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -663,7 +669,7 @@ func (c *regionDisksRESTClient) RemoveResourcePolicies(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -718,7 +724,7 @@ func (c *regionDisksRESTClient) Resize(ctx context.Context, req *computepb.Resiz rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -765,7 +771,10 @@ func (c *regionDisksRESTClient) SetIamPolicy(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetLabels sets the labels on the target regional disk. @@ -817,7 +826,7 @@ func (c *regionDisksRESTClient) SetLabels(ctx context.Context, req *computepb.Se rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -864,5 +873,8 @@ func (c *regionDisksRESTClient) TestIamPermissions(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } diff --git a/compute/apiv1/region_health_check_services_client.go b/compute/apiv1/region_health_check_services_client.go index 8a4597db077..b116ce4a4f0 100644 --- a/compute/apiv1/region_health_check_services_client.go +++ b/compute/apiv1/region_health_check_services_client.go @@ -226,7 +226,7 @@ func (c *regionHealthCheckServicesRESTClient) Delete(ctx context.Context, req *c rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -266,7 +266,10 @@ func (c *regionHealthCheckServicesRESTClient) Get(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.HealthCheckService{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a regional HealthCheckService resource in the specified project and region using the data included in the request. @@ -318,7 +321,7 @@ func (c *regionHealthCheckServicesRESTClient) Insert(ctx context.Context, req *c rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *regionHealthCheckServicesRESTClient) Patch(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_health_checks_client.go b/compute/apiv1/region_health_checks_client.go index e077403ada1..acb123ac389 100644 --- a/compute/apiv1/region_health_checks_client.go +++ b/compute/apiv1/region_health_checks_client.go @@ -233,7 +233,7 @@ func (c *regionHealthChecksRESTClient) Delete(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *regionHealthChecksRESTClient) Get(ctx context.Context, req *computepb.G unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.HealthCheck{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a HealthCheck resource in the specified project using the data included in the request. @@ -325,7 +328,7 @@ func (c *regionHealthChecksRESTClient) Insert(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -464,7 +467,7 @@ func (c *regionHealthChecksRESTClient) Patch(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -519,7 +522,7 @@ func (c *regionHealthChecksRESTClient) Update(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_instance_group_managers_client.go b/compute/apiv1/region_instance_group_managers_client.go index 15385e2e037..3dfc812b726 100644 --- a/compute/apiv1/region_instance_group_managers_client.go +++ b/compute/apiv1/region_instance_group_managers_client.go @@ -353,7 +353,7 @@ func (c *regionInstanceGroupManagersRESTClient) AbandonInstances(ctx context.Con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -401,7 +401,7 @@ func (c *regionInstanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx cont rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -456,7 +456,7 @@ func (c *regionInstanceGroupManagersRESTClient) CreateInstances(ctx context.Cont rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -504,7 +504,7 @@ func (c *regionInstanceGroupManagersRESTClient) Delete(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -563,7 +563,7 @@ func (c *regionInstanceGroupManagersRESTClient) DeleteInstances(ctx context.Cont rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -611,7 +611,7 @@ func (c *regionInstanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -651,7 +651,10 @@ func (c *regionInstanceGroupManagersRESTClient) Get(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstanceGroupManager{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a managed instance group using the information that you specify in the request. After the group is created, instances in the group are created using the specified instance template. This operation is marked as DONE when the group is created even if the instances in the group have not yet been created. You must separately verify the status of the individual instances with the listmanagedinstances method. @@ -705,7 +708,7 @@ func (c *regionInstanceGroupManagersRESTClient) Insert(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1096,7 +1099,7 @@ func (c *regionInstanceGroupManagersRESTClient) Patch(ctx context.Context, req * rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1151,7 +1154,7 @@ func (c *regionInstanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx cont rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1210,7 +1213,7 @@ func (c *regionInstanceGroupManagersRESTClient) RecreateInstances(ctx context.Co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1265,7 +1268,7 @@ func (c *regionInstanceGroupManagersRESTClient) Resize(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1320,7 +1323,7 @@ func (c *regionInstanceGroupManagersRESTClient) SetInstanceTemplate(ctx context. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1375,7 +1378,7 @@ func (c *regionInstanceGroupManagersRESTClient) SetTargetPools(ctx context.Conte rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -1430,7 +1433,7 @@ func (c *regionInstanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx con rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_instance_groups_client.go b/compute/apiv1/region_instance_groups_client.go index 5c6df79f0fc..f6613dc319d 100644 --- a/compute/apiv1/region_instance_groups_client.go +++ b/compute/apiv1/region_instance_groups_client.go @@ -211,7 +211,10 @@ func (c *regionInstanceGroupsRESTClient) Get(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.InstanceGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves the list of instance group resources contained within the specified region. @@ -437,7 +440,7 @@ func (c *regionInstanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_instances_client.go b/compute/apiv1/region_instances_client.go index 7aa61700837..99e78df94a3 100644 --- a/compute/apiv1/region_instances_client.go +++ b/compute/apiv1/region_instances_client.go @@ -202,7 +202,7 @@ func (c *regionInstancesRESTClient) BulkInsert(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_network_endpoint_groups_client.go b/compute/apiv1/region_network_endpoint_groups_client.go index 33f3bdc03f3..b2aeca5ae3e 100644 --- a/compute/apiv1/region_network_endpoint_groups_client.go +++ b/compute/apiv1/region_network_endpoint_groups_client.go @@ -219,7 +219,7 @@ func (c *regionNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -259,7 +259,10 @@ func (c *regionNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NetworkEndpointGroup{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a network endpoint group in the specified project using the parameters that are included in the request. @@ -311,7 +314,7 @@ func (c *regionNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_notification_endpoints_client.go b/compute/apiv1/region_notification_endpoints_client.go index ea6dc3fa136..df7b089a744 100644 --- a/compute/apiv1/region_notification_endpoints_client.go +++ b/compute/apiv1/region_notification_endpoints_client.go @@ -219,7 +219,7 @@ func (c *regionNotificationEndpointsRESTClient) Delete(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -259,7 +259,10 @@ func (c *regionNotificationEndpointsRESTClient) Get(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.NotificationEndpoint{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert create a NotificationEndpoint in the specified project in the given region using the parameters that are included in the request. @@ -311,7 +314,7 @@ func (c *regionNotificationEndpointsRESTClient) Insert(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_operations_client.go b/compute/apiv1/region_operations_client.go index 6311bc169c8..23ec77ce169 100644 --- a/compute/apiv1/region_operations_client.go +++ b/compute/apiv1/region_operations_client.go @@ -216,7 +216,10 @@ func (c *regionOperationsRESTClient) Delete(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DeleteRegionOperationResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Get retrieves the specified region-specific Operations resource. @@ -253,7 +256,10 @@ func (c *regionOperationsRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of Operation resources contained within the specified region. @@ -380,5 +386,8 @@ func (c *regionOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } diff --git a/compute/apiv1/region_ssl_certificates_client.go b/compute/apiv1/region_ssl_certificates_client.go index f46744279dc..5cc1ea8e2b5 100644 --- a/compute/apiv1/region_ssl_certificates_client.go +++ b/compute/apiv1/region_ssl_certificates_client.go @@ -219,7 +219,7 @@ func (c *regionSslCertificatesRESTClient) Delete(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -259,7 +259,10 @@ func (c *regionSslCertificatesRESTClient) Get(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SslCertificate{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a SslCertificate resource in the specified project and region using the data included in the request @@ -311,7 +314,7 @@ func (c *regionSslCertificatesRESTClient) Insert(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_target_http_proxies_client.go b/compute/apiv1/region_target_http_proxies_client.go index 97c8a98d95f..e323ee13b77 100644 --- a/compute/apiv1/region_target_http_proxies_client.go +++ b/compute/apiv1/region_target_http_proxies_client.go @@ -226,7 +226,7 @@ func (c *regionTargetHttpProxiesRESTClient) Delete(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -266,7 +266,10 @@ func (c *regionTargetHttpProxiesRESTClient) Get(ctx context.Context, req *comput unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetHttpProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetHttpProxy resource in the specified project and region using the data included in the request. @@ -318,7 +321,7 @@ func (c *regionTargetHttpProxiesRESTClient) Insert(ctx context.Context, req *com rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *regionTargetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req * rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_target_https_proxies_client.go b/compute/apiv1/region_target_https_proxies_client.go index c0cd6ac454d..8821030df76 100644 --- a/compute/apiv1/region_target_https_proxies_client.go +++ b/compute/apiv1/region_target_https_proxies_client.go @@ -233,7 +233,7 @@ func (c *regionTargetHttpsProxiesRESTClient) Delete(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *regionTargetHttpsProxiesRESTClient) Get(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetHttpsProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request. @@ -325,7 +328,7 @@ func (c *regionTargetHttpsProxiesRESTClient) Insert(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -464,7 +467,7 @@ func (c *regionTargetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Cont rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -519,7 +522,7 @@ func (c *regionTargetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/region_url_maps_client.go b/compute/apiv1/region_url_maps_client.go index d543c541c33..203bab9d60a 100644 --- a/compute/apiv1/region_url_maps_client.go +++ b/compute/apiv1/region_url_maps_client.go @@ -240,7 +240,7 @@ func (c *regionUrlMapsRESTClient) Delete(ctx context.Context, req *computepb.Del rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -280,7 +280,10 @@ func (c *regionUrlMapsRESTClient) Get(ctx context.Context, req *computepb.GetReg unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.UrlMap{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a UrlMap resource in the specified project using the data included in the request. @@ -332,7 +335,7 @@ func (c *regionUrlMapsRESTClient) Insert(ctx context.Context, req *computepb.Ins rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -471,7 +474,7 @@ func (c *regionUrlMapsRESTClient) Patch(ctx context.Context, req *computepb.Patc rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -526,7 +529,7 @@ func (c *regionUrlMapsRESTClient) Update(ctx context.Context, req *computepb.Upd rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -573,7 +576,10 @@ func (c *regionUrlMapsRESTClient) Validate(ctx context.Context, req *computepb.V unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.UrlMapsValidateResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // UrlMapIterator manages a stream of *computepb.UrlMap. diff --git a/compute/apiv1/regions_client.go b/compute/apiv1/regions_client.go index 470c002542a..55e4f3dc434 100644 --- a/compute/apiv1/regions_client.go +++ b/compute/apiv1/regions_client.go @@ -196,7 +196,10 @@ func (c *regionsRESTClient) Get(ctx context.Context, req *computepb.GetRegionReq unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Region{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves the list of region resources available to the specified project. diff --git a/compute/apiv1/reservations_client.go b/compute/apiv1/reservations_client.go index 1077b74243b..c6fa1770e05 100644 --- a/compute/apiv1/reservations_client.go +++ b/compute/apiv1/reservations_client.go @@ -349,7 +349,7 @@ func (c *reservationsRESTClient) Delete(ctx context.Context, req *computepb.Dele rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -389,7 +389,10 @@ func (c *reservationsRESTClient) Get(ctx context.Context, req *computepb.GetRese unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Reservation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -433,7 +436,10 @@ func (c *reservationsRESTClient) GetIamPolicy(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a new reservation. For more information, read Reserving zonal resources. @@ -485,7 +491,7 @@ func (c *reservationsRESTClient) Insert(ctx context.Context, req *computepb.Inse rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -624,7 +630,7 @@ func (c *reservationsRESTClient) Resize(ctx context.Context, req *computepb.Resi rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -671,7 +677,10 @@ func (c *reservationsRESTClient) SetIamPolicy(ctx context.Context, req *computep unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. @@ -715,7 +724,10 @@ func (c *reservationsRESTClient) TestIamPermissions(ctx context.Context, req *co unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // ReservationIterator manages a stream of *computepb.Reservation. diff --git a/compute/apiv1/resource_policies_client.go b/compute/apiv1/resource_policies_client.go index b083cf8ad1a..e3964f85e29 100644 --- a/compute/apiv1/resource_policies_client.go +++ b/compute/apiv1/resource_policies_client.go @@ -342,7 +342,7 @@ func (c *resourcePoliciesRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -382,7 +382,10 @@ func (c *resourcePoliciesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.ResourcePolicy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -426,7 +429,10 @@ func (c *resourcePoliciesRESTClient) GetIamPolicy(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a new resource policy. @@ -478,7 +484,7 @@ func (c *resourcePoliciesRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -609,7 +615,10 @@ func (c *resourcePoliciesRESTClient) SetIamPolicy(ctx context.Context, req *comp unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // TestIamPermissions returns permissions that a caller has on the specified resource. @@ -653,7 +662,10 @@ func (c *resourcePoliciesRESTClient) TestIamPermissions(ctx context.Context, req unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // ResourcePoliciesScopedListPair is a holder type for string/*computepb.ResourcePoliciesScopedList map entries diff --git a/compute/apiv1/routers_client.go b/compute/apiv1/routers_client.go index f00c2491e9c..8e5c2d190c0 100644 --- a/compute/apiv1/routers_client.go +++ b/compute/apiv1/routers_client.go @@ -356,7 +356,7 @@ func (c *routersRESTClient) Delete(ctx context.Context, req *computepb.DeleteRou rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -396,7 +396,10 @@ func (c *routersRESTClient) Get(ctx context.Context, req *computepb.GetRouterReq unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Router{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetNatMappingInfo retrieves runtime Nat mapping information of VM endpoints. @@ -517,7 +520,10 @@ func (c *routersRESTClient) GetRouterStatus(ctx context.Context, req *computepb. unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.RouterStatusResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a Router resource in the specified project and region using the data included in the request. @@ -569,7 +575,7 @@ func (c *routersRESTClient) Insert(ctx context.Context, req *computepb.InsertRou rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -708,7 +714,7 @@ func (c *routersRESTClient) Patch(ctx context.Context, req *computepb.PatchRoute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -755,7 +761,10 @@ func (c *routersRESTClient) Preview(ctx context.Context, req *computepb.PreviewR unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.RoutersPreviewResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Update updates the specified Router resource with the data included in the request. This method conforms to PUT semantics, which requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message payload. @@ -807,7 +816,7 @@ func (c *routersRESTClient) Update(ctx context.Context, req *computepb.UpdateRou rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/routes_client.go b/compute/apiv1/routes_client.go index 8a8108a261e..6e686a9531b 100644 --- a/compute/apiv1/routes_client.go +++ b/compute/apiv1/routes_client.go @@ -219,7 +219,7 @@ func (c *routesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRout rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -259,7 +259,10 @@ func (c *routesRESTClient) Get(ctx context.Context, req *computepb.GetRouteReque unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Route{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a Route resource in the specified project using the data included in the request. @@ -311,7 +314,7 @@ func (c *routesRESTClient) Insert(ctx context.Context, req *computepb.InsertRout rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/security_policies_client.go b/compute/apiv1/security_policies_client.go index 89311807512..9630494c378 100644 --- a/compute/apiv1/security_policies_client.go +++ b/compute/apiv1/security_policies_client.go @@ -261,7 +261,7 @@ func (c *securityPoliciesRESTClient) AddRule(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -309,7 +309,7 @@ func (c *securityPoliciesRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -349,7 +349,10 @@ func (c *securityPoliciesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SecurityPolicy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetRule gets a rule at the specified priority. @@ -393,7 +396,10 @@ func (c *securityPoliciesRESTClient) GetRule(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SecurityPolicyRule{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a new policy in the specified project using the data included in the request. @@ -445,7 +451,7 @@ func (c *securityPoliciesRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -588,7 +594,10 @@ func (c *securityPoliciesRESTClient) ListPreconfiguredExpressionSets(ctx context unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SecurityPoliciesListPreconfiguredExpressionSetsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Patch patches the specified policy with the data included in the request. This cannot be used to be update the rules in the policy. Please use the per rule methods like addRule, patchRule, and removeRule instead. @@ -640,7 +649,7 @@ func (c *securityPoliciesRESTClient) Patch(ctx context.Context, req *computepb.P rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -695,7 +704,7 @@ func (c *securityPoliciesRESTClient) PatchRule(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -743,7 +752,7 @@ func (c *securityPoliciesRESTClient) RemoveRule(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/snapshots_client.go b/compute/apiv1/snapshots_client.go index 49098a24ba7..a731565dd4b 100644 --- a/compute/apiv1/snapshots_client.go +++ b/compute/apiv1/snapshots_client.go @@ -244,7 +244,7 @@ func (c *snapshotsRESTClient) Delete(ctx context.Context, req *computepb.DeleteS rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -284,7 +284,10 @@ func (c *snapshotsRESTClient) Get(ctx context.Context, req *computepb.GetSnapsho unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Snapshot{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -328,7 +331,10 @@ func (c *snapshotsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.G unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves the list of Snapshot resources contained within the specified project. @@ -456,7 +462,10 @@ func (c *snapshotsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.S unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetLabels sets the labels on a snapshot. To learn more about labels, read the Labeling Resources documentation. @@ -501,7 +510,7 @@ func (c *snapshotsRESTClient) SetLabels(ctx context.Context, req *computepb.SetL rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -548,7 +557,10 @@ func (c *snapshotsRESTClient) TestIamPermissions(ctx context.Context, req *compu unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SnapshotIterator manages a stream of *computepb.Snapshot. diff --git a/compute/apiv1/ssl_certificates_client.go b/compute/apiv1/ssl_certificates_client.go index 84f4adb22ce..3ff1bb713fd 100644 --- a/compute/apiv1/ssl_certificates_client.go +++ b/compute/apiv1/ssl_certificates_client.go @@ -321,7 +321,7 @@ func (c *sslCertificatesRESTClient) Delete(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -361,7 +361,10 @@ func (c *sslCertificatesRESTClient) Get(ctx context.Context, req *computepb.GetS unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SslCertificate{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a SslCertificate resource in the specified project using the data included in the request. @@ -413,7 +416,7 @@ func (c *sslCertificatesRESTClient) Insert(ctx context.Context, req *computepb.I rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/ssl_policies_client.go b/compute/apiv1/ssl_policies_client.go index c70667501e8..d221b58f5a8 100644 --- a/compute/apiv1/ssl_policies_client.go +++ b/compute/apiv1/ssl_policies_client.go @@ -233,7 +233,7 @@ func (c *sslPoliciesRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *sslPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetSslPo unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SslPolicy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert returns the specified SSL policy resource. Gets a list of available SSL policies by making a list() request. @@ -325,7 +328,7 @@ func (c *sslPoliciesRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -468,7 +471,10 @@ func (c *sslPoliciesRESTClient) ListAvailableFeatures(ctx context.Context, req * unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.SslPoliciesListAvailableFeaturesResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Patch patches the specified SSL policy with the data included in the request. @@ -520,7 +526,7 @@ func (c *sslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchS rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/subnetworks_client.go b/compute/apiv1/subnetworks_client.go index 44e43086ed5..716193d66e6 100644 --- a/compute/apiv1/subnetworks_client.go +++ b/compute/apiv1/subnetworks_client.go @@ -370,7 +370,7 @@ func (c *subnetworksRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -425,7 +425,7 @@ func (c *subnetworksRESTClient) ExpandIpCidrRange(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -465,7 +465,10 @@ func (c *subnetworksRESTClient) Get(ctx context.Context, req *computepb.GetSubne unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Subnetwork{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. @@ -509,7 +512,10 @@ func (c *subnetworksRESTClient) GetIamPolicy(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a subnetwork in the specified project using the data included in the request. @@ -561,7 +567,7 @@ func (c *subnetworksRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -787,7 +793,7 @@ func (c *subnetworksRESTClient) Patch(ctx context.Context, req *computepb.PatchS rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -834,7 +840,10 @@ func (c *subnetworksRESTClient) SetIamPolicy(ctx context.Context, req *computepb unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Policy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SetPrivateIpGoogleAccess set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. @@ -886,7 +895,7 @@ func (c *subnetworksRESTClient) SetPrivateIpGoogleAccess(ctx context.Context, re rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -933,7 +942,10 @@ func (c *subnetworksRESTClient) TestIamPermissions(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // SubnetworkIterator manages a stream of *computepb.Subnetwork. diff --git a/compute/apiv1/target_grpc_proxies_client.go b/compute/apiv1/target_grpc_proxies_client.go index 26306e02082..52ecd1ac889 100644 --- a/compute/apiv1/target_grpc_proxies_client.go +++ b/compute/apiv1/target_grpc_proxies_client.go @@ -226,7 +226,7 @@ func (c *targetGrpcProxiesRESTClient) Delete(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -266,7 +266,10 @@ func (c *targetGrpcProxiesRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetGrpcProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetGrpcProxy in the specified project in the given scope using the parameters that are included in the request. @@ -318,7 +321,7 @@ func (c *targetGrpcProxiesRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -457,7 +460,7 @@ func (c *targetGrpcProxiesRESTClient) Patch(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_http_proxies_client.go b/compute/apiv1/target_http_proxies_client.go index c300bae56d4..c1adc1fbbe1 100644 --- a/compute/apiv1/target_http_proxies_client.go +++ b/compute/apiv1/target_http_proxies_client.go @@ -335,7 +335,7 @@ func (c *targetHttpProxiesRESTClient) Delete(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -375,7 +375,10 @@ func (c *targetHttpProxiesRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetHttpProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetHttpProxy resource in the specified project using the data included in the request. @@ -427,7 +430,7 @@ func (c *targetHttpProxiesRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -566,7 +569,7 @@ func (c *targetHttpProxiesRESTClient) Patch(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -621,7 +624,7 @@ func (c *targetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *comput rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_https_proxies_client.go b/compute/apiv1/target_https_proxies_client.go index e6c02930a5c..a4811c5bd61 100644 --- a/compute/apiv1/target_https_proxies_client.go +++ b/compute/apiv1/target_https_proxies_client.go @@ -356,7 +356,7 @@ func (c *targetHttpsProxiesRESTClient) Delete(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -396,7 +396,10 @@ func (c *targetHttpsProxiesRESTClient) Get(ctx context.Context, req *computepb.G unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetHttpsProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetHttpsProxy resource in the specified project using the data included in the request. @@ -448,7 +451,7 @@ func (c *targetHttpsProxiesRESTClient) Insert(ctx context.Context, req *computep rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -587,7 +590,7 @@ func (c *targetHttpsProxiesRESTClient) Patch(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -642,7 +645,7 @@ func (c *targetHttpsProxiesRESTClient) SetQuicOverride(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -697,7 +700,7 @@ func (c *targetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Context, r rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -752,7 +755,7 @@ func (c *targetHttpsProxiesRESTClient) SetSslPolicy(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -807,7 +810,7 @@ func (c *targetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req *compu rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_instances_client.go b/compute/apiv1/target_instances_client.go index 9a950645112..a3318d86ead 100644 --- a/compute/apiv1/target_instances_client.go +++ b/compute/apiv1/target_instances_client.go @@ -321,7 +321,7 @@ func (c *targetInstancesRESTClient) Delete(ctx context.Context, req *computepb.D rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -361,7 +361,10 @@ func (c *targetInstancesRESTClient) Get(ctx context.Context, req *computepb.GetT unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetInstance{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetInstance resource in the specified project and zone using the data included in the request. @@ -413,7 +416,7 @@ func (c *targetInstancesRESTClient) Insert(ctx context.Context, req *computepb.I rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_pools_client.go b/compute/apiv1/target_pools_client.go index 944fd812ce0..7e76118b9e4 100644 --- a/compute/apiv1/target_pools_client.go +++ b/compute/apiv1/target_pools_client.go @@ -276,7 +276,7 @@ func (c *targetPoolsRESTClient) AddHealthCheck(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -331,7 +331,7 @@ func (c *targetPoolsRESTClient) AddInstance(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -473,7 +473,7 @@ func (c *targetPoolsRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -513,7 +513,10 @@ func (c *targetPoolsRESTClient) Get(ctx context.Context, req *computepb.GetTarge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetPool{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetHealth gets the most recent health check results for each IP for the instance that is referenced by the given target pool. @@ -557,7 +560,10 @@ func (c *targetPoolsRESTClient) GetHealth(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetPoolInstanceHealth{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a target pool in the specified project and region using the data included in the request. @@ -609,7 +615,7 @@ func (c *targetPoolsRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -748,7 +754,7 @@ func (c *targetPoolsRESTClient) RemoveHealthCheck(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -803,7 +809,7 @@ func (c *targetPoolsRESTClient) RemoveInstance(ctx context.Context, req *compute rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -861,7 +867,7 @@ func (c *targetPoolsRESTClient) SetBackup(ctx context.Context, req *computepb.Se rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_ssl_proxies_client.go b/compute/apiv1/target_ssl_proxies_client.go index 9b8c5697665..6caa2e43268 100644 --- a/compute/apiv1/target_ssl_proxies_client.go +++ b/compute/apiv1/target_ssl_proxies_client.go @@ -247,7 +247,7 @@ func (c *targetSslProxiesRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -287,7 +287,10 @@ func (c *targetSslProxiesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetSslProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetSslProxy resource in the specified project using the data included in the request. @@ -339,7 +342,7 @@ func (c *targetSslProxiesRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -478,7 +481,7 @@ func (c *targetSslProxiesRESTClient) SetBackendService(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -533,7 +536,7 @@ func (c *targetSslProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -588,7 +591,7 @@ func (c *targetSslProxiesRESTClient) SetSslCertificates(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -643,7 +646,7 @@ func (c *targetSslProxiesRESTClient) SetSslPolicy(ctx context.Context, req *comp rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_tcp_proxies_client.go b/compute/apiv1/target_tcp_proxies_client.go index b9dc03bda7b..947b84c042c 100644 --- a/compute/apiv1/target_tcp_proxies_client.go +++ b/compute/apiv1/target_tcp_proxies_client.go @@ -233,7 +233,7 @@ func (c *targetTcpProxiesRESTClient) Delete(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -273,7 +273,10 @@ func (c *targetTcpProxiesRESTClient) Get(ctx context.Context, req *computepb.Get unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetTcpProxy{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a TargetTcpProxy resource in the specified project using the data included in the request. @@ -325,7 +328,7 @@ func (c *targetTcpProxiesRESTClient) Insert(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -464,7 +467,7 @@ func (c *targetTcpProxiesRESTClient) SetBackendService(ctx context.Context, req rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -519,7 +522,7 @@ func (c *targetTcpProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/target_vpn_gateways_client.go b/compute/apiv1/target_vpn_gateways_client.go index 8df39203b3a..84ab0004e66 100644 --- a/compute/apiv1/target_vpn_gateways_client.go +++ b/compute/apiv1/target_vpn_gateways_client.go @@ -321,7 +321,7 @@ func (c *targetVpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -361,7 +361,10 @@ func (c *targetVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TargetVpnGateway{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a target VPN gateway in the specified project and region using the data included in the request. @@ -413,7 +416,7 @@ func (c *targetVpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/url_maps_client.go b/compute/apiv1/url_maps_client.go index aa405601339..06632d0b13f 100644 --- a/compute/apiv1/url_maps_client.go +++ b/compute/apiv1/url_maps_client.go @@ -351,7 +351,7 @@ func (c *urlMapsRESTClient) Delete(ctx context.Context, req *computepb.DeleteUrl rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -391,7 +391,10 @@ func (c *urlMapsRESTClient) Get(ctx context.Context, req *computepb.GetUrlMapReq unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.UrlMap{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a UrlMap resource in the specified project using the data included in the request. @@ -443,7 +446,7 @@ func (c *urlMapsRESTClient) Insert(ctx context.Context, req *computepb.InsertUrl rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -500,7 +503,7 @@ func (c *urlMapsRESTClient) InvalidateCache(ctx context.Context, req *computepb. rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -639,7 +642,7 @@ func (c *urlMapsRESTClient) Patch(ctx context.Context, req *computepb.PatchUrlMa rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -694,7 +697,7 @@ func (c *urlMapsRESTClient) Update(ctx context.Context, req *computepb.UpdateUrl rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -741,7 +744,10 @@ func (c *urlMapsRESTClient) Validate(ctx context.Context, req *computepb.Validat unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.UrlMapsValidateResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // UrlMapsScopedListPair is a holder type for string/*computepb.UrlMapsScopedList map entries diff --git a/compute/apiv1/vpn_gateways_client.go b/compute/apiv1/vpn_gateways_client.go index 4869d160a1a..9084f95a2b2 100644 --- a/compute/apiv1/vpn_gateways_client.go +++ b/compute/apiv1/vpn_gateways_client.go @@ -342,7 +342,7 @@ func (c *vpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb.Delet rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -382,7 +382,10 @@ func (c *vpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.GetVpnGa unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.VpnGateway{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // GetStatus returns the status for the specified VPN gateway. @@ -419,7 +422,10 @@ func (c *vpnGatewaysRESTClient) GetStatus(ctx context.Context, req *computepb.Ge unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.VpnGatewaysGetStatusResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a VPN gateway in the specified project and region using the data included in the request. @@ -471,7 +477,7 @@ func (c *vpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb.Inser rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -610,7 +616,7 @@ func (c *vpnGatewaysRESTClient) SetLabels(ctx context.Context, req *computepb.Se rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -657,7 +663,10 @@ func (c *vpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, req *com unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.TestPermissionsResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // VpnGatewayIterator manages a stream of *computepb.VpnGateway. diff --git a/compute/apiv1/vpn_tunnels_client.go b/compute/apiv1/vpn_tunnels_client.go index 4d8297d76c6..a1101f7014b 100644 --- a/compute/apiv1/vpn_tunnels_client.go +++ b/compute/apiv1/vpn_tunnels_client.go @@ -321,7 +321,7 @@ func (c *vpnTunnelsRESTClient) Delete(ctx context.Context, req *computepb.Delete rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err @@ -361,7 +361,10 @@ func (c *vpnTunnelsRESTClient) Get(ctx context.Context, req *computepb.GetVpnTun unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.VpnTunnel{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Insert creates a VpnTunnel resource in the specified project and region using the data included in the request. @@ -413,7 +416,7 @@ func (c *vpnTunnelsRESTClient) Insert(ctx context.Context, req *computepb.Insert rsp := &computepb.Operation{} if err := unm.Unmarshal(buf, rsp); err != nil { - return nil, err + return nil, maybeUnknownEnum(err) } op := &Operation{proto: rsp} return op, err diff --git a/compute/apiv1/zone_operations_client.go b/compute/apiv1/zone_operations_client.go index 2185f8ed2ac..be5b7f1126e 100644 --- a/compute/apiv1/zone_operations_client.go +++ b/compute/apiv1/zone_operations_client.go @@ -216,7 +216,10 @@ func (c *zoneOperationsRESTClient) Delete(ctx context.Context, req *computepb.De unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.DeleteZoneOperationResponse{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // Get retrieves the specified zone-specific Operations resource. @@ -253,7 +256,10 @@ func (c *zoneOperationsRESTClient) Get(ctx context.Context, req *computepb.GetZo unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves a list of Operation resources contained within the specified zone. @@ -380,5 +386,8 @@ func (c *zoneOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wait unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Operation{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } diff --git a/compute/apiv1/zones_client.go b/compute/apiv1/zones_client.go index 3007b433f99..ce8c1bcf3f4 100644 --- a/compute/apiv1/zones_client.go +++ b/compute/apiv1/zones_client.go @@ -196,7 +196,10 @@ func (c *zonesRESTClient) Get(ctx context.Context, req *computepb.GetZoneRequest unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} rsp := &computepb.Zone{} - return rsp, unm.Unmarshal(buf, rsp) + if err := unm.Unmarshal(buf, rsp); err != nil { + return nil, maybeUnknownEnum(err) + } + return rsp, nil } // List retrieves the list of Zone resources available to the specified project. diff --git a/functions/apiv1/doc.go b/functions/apiv1/doc.go index af230599bc9..e8a852a5922 100644 --- a/functions/apiv1/doc.go +++ b/functions/apiv1/doc.go @@ -91,7 +91,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210821" +const versionClient = "20210915" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/functions/go.mod b/functions/go.mod index e700d927d69..b8285c3dbf1 100644 --- a/functions/go.mod +++ b/functions/go.mod @@ -5,9 +5,9 @@ go 1.16 require ( cloud.google.com/go v0.93.3 github.com/google/go-cmp v0.5.6 - github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.54.0 - google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 + github.com/googleapis/gax-go/v2 v2.1.0 + google.golang.org/api v0.56.0 + google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/functions/go.sum b/functions/go.sum index 5bfcfa190f2..616387f958e 100644 --- a/functions/go.sum +++ b/functions/go.sum @@ -138,8 +138,9 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -263,8 +264,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -318,8 +320,9 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -414,8 +417,9 @@ google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59t google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0 h1:ECJUVngj71QI6XEm7b1sAf8BljU5inEhMbKPR8Lxhhk= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0 h1:08F9XVYTLOGeSQb3xI9C0gXMuQanhdGed0cWFhDozbI= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -474,8 +478,10 @@ google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 h1:XosVttQUxX8erNhEruTu053/VchgYuksoS9Bj/OITjU= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af h1:aLMMXFYqw01RA6XJim5uaN+afqNNjc9P8HPAbnpnc5s= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= diff --git a/internal/.repo-metadata-full.json b/internal/.repo-metadata-full.json index cff84f5453f..1bc5928e683 100644 --- a/internal/.repo-metadata-full.json +++ b/internal/.repo-metadata-full.json @@ -320,7 +320,7 @@ "language": "Go", "client_library_type": "generated", "docs_url": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/compute/apiv1", - "release_level": "alpha", + "release_level": "beta", "library_type": "" }, "cloud.google.com/go/compute/metadata": { diff --git a/spanner/go.sum b/spanner/go.sum index 5a226618528..06b23fdff5e 100644 --- a/spanner/go.sum +++ b/spanner/go.sum @@ -213,7 +213,6 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.2 h1:Gz96sIWK3OalVv/I/qNygP42zyoKp3xptRVCWRFEBvo= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -384,7 +383,6 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/talent/apiv4/doc.go b/talent/apiv4/doc.go index 7941ac3768a..77478a3607e 100644 --- a/talent/apiv4/doc.go +++ b/talent/apiv4/doc.go @@ -87,7 +87,7 @@ import ( type clientHookParams struct{} type clientHook func(context.Context, clientHookParams) ([]option.ClientOption, error) -const versionClient = "20210821" +const versionClient = "20210915" func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context { out, _ := metadata.FromOutgoingContext(ctx) diff --git a/talent/go.mod b/talent/go.mod index 9f581ef61f5..ede300059c0 100644 --- a/talent/go.mod +++ b/talent/go.mod @@ -5,9 +5,9 @@ go 1.16 require ( cloud.google.com/go v0.93.3 github.com/golang/protobuf v1.5.2 - github.com/googleapis/gax-go/v2 v2.0.5 - google.golang.org/api v0.54.0 - google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 + github.com/googleapis/gax-go/v2 v2.1.0 + google.golang.org/api v0.56.0 + google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 ) diff --git a/talent/go.sum b/talent/go.sum index 5bfcfa190f2..616387f958e 100644 --- a/talent/go.sum +++ b/talent/go.sum @@ -138,8 +138,9 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0 h1:6DWmvNpomjL1+3liNSZbVns3zsYzzCjm6pRBO1tLeso= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -263,8 +264,9 @@ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a h1:4Kd8OPUx1xgUwrHDaviWZO8MsgoZTZYC3g+8m16RBww= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -318,8 +320,9 @@ golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069 h1:siQdpVirKtzPhKl3lZWozZraCFObP8S1v6PRp0bLrtU= golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf h1:2ucpDCmfkl8Bd/FsLtiD653Wf96cW37s+iGx93zsu4k= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -414,8 +417,9 @@ google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59t google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= -google.golang.org/api v0.54.0 h1:ECJUVngj71QI6XEm7b1sAf8BljU5inEhMbKPR8Lxhhk= google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0 h1:08F9XVYTLOGeSQb3xI9C0gXMuQanhdGed0cWFhDozbI= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -474,8 +478,10 @@ google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= -google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8 h1:XosVttQUxX8erNhEruTu053/VchgYuksoS9Bj/OITjU= google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af h1:aLMMXFYqw01RA6XJim5uaN+afqNNjc9P8HPAbnpnc5s= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=