From a679a5a9b1ea60cb155eb6c8be4afcc43d3b121f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 15 Sep 2022 08:08:49 -0700 Subject: [PATCH] chore(all): auto-regenerate gapics (#6676) * chore(all): auto-regenerate gapics 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/896 Changes: chore(analytics/admin): Explicitly set transport to grpc for python targets PiperOrigin-RevId: 474394710 Source-Link: https://github.com/googleapis/googleapis/commit/8f81accbe688b16b62c2d1c4f94ef8f7880c7dc9 docs(run): Fix the main client gem name listed in the readme PiperOrigin-RevId: 474346224 Source-Link: https://github.com/googleapis/googleapis/commit/0647eab532d26381b1a7a9e33e746b6af47440ca feat(compute): Update Compute Engine API to revision 20220831 (#729) Source-Link: https://github.com/googleapis/googleapis/commit/63c3007b209d79baf8106e6f5adf9d73896116cb feat(securitycenter): Added parent display name i.e. source display name for a finding as one of the finding attributes PiperOrigin-RevId: 474319054 Source-Link: https://github.com/googleapis/googleapis/commit/862f99facd3b670eda5bd17fd367a93111381326 --- analytics/go.mod | 8 +- analytics/go.sum | 14 +- compute/apiv1/addresses_client.go | 83 ++ .../apiv1/addresses_client_example_test.go | 28 + compute/apiv1/backend_services_client.go | 136 ++ .../backend_services_client_example_test.go | 50 + compute/apiv1/gapic_metadata.json | 128 ++ compute/apiv1/global_addresses_client.go | 91 +- .../global_addresses_client_example_test.go | 28 + .../apiv1/interconnect_attachments_client.go | 83 ++ ...connect_attachments_client_example_test.go | 28 + compute/apiv1/interconnects_client.go | 75 ++ .../interconnects_client_example_test.go | 28 + .../apiv1/region_backend_services_client.go | 164 ++- ...on_backend_services_client_example_test.go | 50 + compute/apiv1/region_ssl_policies_client.go | 711 ++++++++++ ...region_ssl_policies_client_example_test.go | 207 +++ .../apiv1/region_target_tcp_proxies_client.go | 548 ++++++++ ..._target_tcp_proxies_client_example_test.go | 154 +++ compute/apiv1/security_policies_client.go | 75 ++ .../security_policies_client_example_test.go | 28 + compute/apiv1/ssl_policies_client.go | 139 +- .../apiv1/ssl_policies_client_example_test.go | 31 + compute/apiv1/target_tcp_proxies_client.go | 47 - compute/apiv1/target_vpn_gateways_client.go | 83 ++ ...target_vpn_gateways_client_example_test.go | 28 + compute/apiv1/vpn_tunnels_client.go | 83 ++ .../apiv1/vpn_tunnels_client_example_test.go | 28 + compute/go.mod | 8 +- compute/go.sum | 19 +- go.mod | 8 +- go.sum | 14 +- ...a.google.cloud.bigquery.connection.v1.json | 2 +- ...gle.cloud.bigquery.connection.v1beta1.json | 2 +- ...e.cloud.bigquery.dataexchange.v1beta1.json | 2 +- ...google.cloud.bigquery.datatransfer.v1.json | 2 +- ...ta.google.cloud.bigquery.migration.v2.json | 2 +- ...ogle.cloud.bigquery.migration.v2alpha.json | 2 +- ....google.cloud.bigquery.reservation.v1.json | 2 +- ...le.cloud.bigquery.reservation.v1beta1.json | 2 +- ...data.google.cloud.bigquery.storage.v1.json | 2 +- ...google.cloud.bigquery.storage.v1beta1.json | 2 +- ...google.cloud.bigquery.storage.v1beta2.json | 2 +- .../apiv1/AddressesClient/SetLabels/main.go | 56 + .../GetIamPolicy/main.go | 53 + .../SetIamPolicy/main.go | 53 + .../GlobalAddressesClient/SetLabels/main.go | 56 + .../SetLabels/main.go | 56 + .../InterconnectsClient/SetLabels/main.go | 56 + .../GetIamPolicy/main.go | 53 + .../SetIamPolicy/main.go | 53 + .../RegionSslPoliciesClient/Delete/main.go | 56 + .../apiv1/RegionSslPoliciesClient/Get/main.go | 53 + .../RegionSslPoliciesClient/Insert/main.go | 56 + .../RegionSslPoliciesClient/List/main.go | 60 + .../ListAvailableFeatures/main.go | 53 + .../RegionSslPoliciesClient/Patch/main.go | 56 + .../Delete/main.go | 56 + .../RegionTargetTcpProxiesClient/Get/main.go | 53 + .../Insert/main.go | 56 + .../RegionTargetTcpProxiesClient/List/main.go | 60 + .../SecurityPoliciesClient/SetLabels/main.go | 56 + .../SslPoliciesClient/AggregatedList/main.go | 60 + .../TargetVpnGatewaysClient/SetLabels/main.go | 56 + .../apiv1/VpnTunnelsClient/SetLabels/main.go | 56 + ...ppet_metadata.google.cloud.compute.v1.json | 1168 +++++++++++++++-- internal/generated/snippets/go.mod | 6 +- internal/generated/snippets/go.sum | 10 +- internal/godocfx/go.mod | 8 +- internal/godocfx/go.sum | 14 +- run/go.mod | 8 +- run/go.sum | 15 +- securitycenter/go.mod | 8 +- securitycenter/go.sum | 19 +- 74 files changed, 5471 insertions(+), 235 deletions(-) create mode 100644 compute/apiv1/region_ssl_policies_client.go create mode 100644 compute/apiv1/region_ssl_policies_client_example_test.go create mode 100644 compute/apiv1/region_target_tcp_proxies_client.go create mode 100644 compute/apiv1/region_target_tcp_proxies_client_example_test.go create mode 100644 internal/generated/snippets/compute/apiv1/AddressesClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/BackendServicesClient/GetIamPolicy/main.go create mode 100644 internal/generated/snippets/compute/apiv1/BackendServicesClient/SetIamPolicy/main.go create mode 100644 internal/generated/snippets/compute/apiv1/GlobalAddressesClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/InterconnectAttachmentsClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/InterconnectsClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/GetIamPolicy/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/SetIamPolicy/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Delete/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Get/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Insert/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/List/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/ListAvailableFeatures/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Patch/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Delete/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Get/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Insert/main.go create mode 100644 internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/List/main.go create mode 100644 internal/generated/snippets/compute/apiv1/SecurityPoliciesClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/SslPoliciesClient/AggregatedList/main.go create mode 100644 internal/generated/snippets/compute/apiv1/TargetVpnGatewaysClient/SetLabels/main.go create mode 100644 internal/generated/snippets/compute/apiv1/VpnTunnelsClient/SetLabels/main.go diff --git a/analytics/go.mod b/analytics/go.mod index 33783e61ee2..b263b53284e 100644 --- a/analytics/go.mod +++ b/analytics/go.mod @@ -4,8 +4,8 @@ go 1.17 require ( github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 ) @@ -17,9 +17,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/analytics/go.sum b/analytics/go.sum index d10a458c441..676579e3fa7 100644 --- a/analytics/go.sum +++ b/analytics/go.sum @@ -293,8 +293,9 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -389,8 +390,9 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -504,8 +506,8 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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= @@ -595,8 +597,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f h1:wwbo0UziciPT4Dsca+bmplW53QNAl7tiUOw7FfAcsf8= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de h1:5ANeKFmGdtiputJJYeUVg8nTGA/1bEirx4CgzcnPSx8= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= 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/compute/apiv1/addresses_client.go b/compute/apiv1/addresses_client.go index 7ebbf742241..e5f643d7134 100644 --- a/compute/apiv1/addresses_client.go +++ b/compute/apiv1/addresses_client.go @@ -48,6 +48,7 @@ type AddressesCallOptions struct { Get []gax.CallOption Insert []gax.CallOption List []gax.CallOption + SetLabels []gax.CallOption } func defaultAddressesRESTCallOptions() *AddressesCallOptions { @@ -57,6 +58,7 @@ func defaultAddressesRESTCallOptions() *AddressesCallOptions { Get: []gax.CallOption{}, Insert: []gax.CallOption{}, List: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -70,6 +72,7 @@ type internalAddressesClient interface { Get(context.Context, *computepb.GetAddressRequest, ...gax.CallOption) (*computepb.Address, error) Insert(context.Context, *computepb.InsertAddressRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListAddressesRequest, ...gax.CallOption) *AddressIterator + SetLabels(context.Context, *computepb.SetLabelsAddressRequest, ...gax.CallOption) (*Operation, error) } // AddressesClient is a client for interacting with Google Compute Engine API. @@ -132,6 +135,11 @@ func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddresses return c.internalClient.List(ctx, req, opts...) } +// SetLabels sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. +func (c *AddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type addressesRESTClient struct { // The http endpoint to connect to. @@ -615,6 +623,81 @@ func (c *addressesRESTClient) List(ctx context.Context, req *computepb.ListAddre return it } +// SetLabels sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation. +func (c *addressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + // AddressIterator manages a stream of *computepb.Address. type AddressIterator struct { items []*computepb.Address diff --git a/compute/apiv1/addresses_client_example_test.go b/compute/apiv1/addresses_client_example_test.go index 04b2edad98d..91d1a2a7cbf 100644 --- a/compute/apiv1/addresses_client_example_test.go +++ b/compute/apiv1/addresses_client_example_test.go @@ -183,3 +183,31 @@ func ExampleAddressesClient_List() { _ = resp } } + +func ExampleAddressesClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsAddressRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsAddressRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/backend_services_client.go b/compute/apiv1/backend_services_client.go index 20668e3fab6..a332027bb33 100644 --- a/compute/apiv1/backend_services_client.go +++ b/compute/apiv1/backend_services_client.go @@ -49,10 +49,12 @@ type BackendServicesCallOptions struct { DeleteSignedUrlKey []gax.CallOption Get []gax.CallOption GetHealth []gax.CallOption + GetIamPolicy []gax.CallOption Insert []gax.CallOption List []gax.CallOption Patch []gax.CallOption SetEdgeSecurityPolicy []gax.CallOption + SetIamPolicy []gax.CallOption SetSecurityPolicy []gax.CallOption Update []gax.CallOption } @@ -65,10 +67,12 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions { DeleteSignedUrlKey: []gax.CallOption{}, Get: []gax.CallOption{}, GetHealth: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, Insert: []gax.CallOption{}, List: []gax.CallOption{}, Patch: []gax.CallOption{}, SetEdgeSecurityPolicy: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, SetSecurityPolicy: []gax.CallOption{}, Update: []gax.CallOption{}, } @@ -85,10 +89,12 @@ type internalBackendServicesClient interface { DeleteSignedUrlKey(context.Context, *computepb.DeleteSignedUrlKeyBackendServiceRequest, ...gax.CallOption) (*Operation, error) Get(context.Context, *computepb.GetBackendServiceRequest, ...gax.CallOption) (*computepb.BackendService, error) GetHealth(context.Context, *computepb.GetHealthBackendServiceRequest, ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error) Insert(context.Context, *computepb.InsertBackendServiceRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator Patch(context.Context, *computepb.PatchBackendServiceRequest, ...gax.CallOption) (*Operation, error) SetEdgeSecurityPolicy(context.Context, *computepb.SetEdgeSecurityPolicyBackendServiceRequest, ...gax.CallOption) (*Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error) SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyBackendServiceRequest, ...gax.CallOption) (*Operation, error) Update(context.Context, *computepb.UpdateBackendServiceRequest, ...gax.CallOption) (*Operation, error) } @@ -158,6 +164,11 @@ func (c *BackendServicesClient) GetHealth(ctx context.Context, req *computepb.Ge return c.internalClient.GetHealth(ctx, req, opts...) } +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *BackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + // Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview . func (c *BackendServicesClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.Insert(ctx, req, opts...) @@ -178,6 +189,11 @@ func (c *BackendServicesClient) SetEdgeSecurityPolicy(ctx context.Context, req * return c.internalClient.SetEdgeSecurityPolicy(ctx, req, opts...) } +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *BackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + // SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview func (c *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.SetSecurityPolicy(ctx, req, opts...) @@ -701,6 +717,66 @@ func (c *backendServicesRESTClient) GetHealth(ctx context.Context, req *computep return resp, nil } +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *backendServicesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/getIamPolicy", req.GetProject(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + // Insert creates a BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview . func (c *backendServicesRESTClient) Insert(ctx context.Context, req *computepb.InsertBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} @@ -1019,6 +1095,66 @@ func (c *backendServicesRESTClient) SetEdgeSecurityPolicy(ctx context.Context, r return op, nil } +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *backendServicesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetGlobalSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendServices/%v/setIamPolicy", req.GetProject(), req.GetResource()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + // SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview func (c *backendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} diff --git a/compute/apiv1/backend_services_client_example_test.go b/compute/apiv1/backend_services_client_example_test.go index 1c7cf2913ef..6cf6645c1c5 100644 --- a/compute/apiv1/backend_services_client_example_test.go +++ b/compute/apiv1/backend_services_client_example_test.go @@ -206,6 +206,31 @@ func ExampleBackendServicesClient_GetHealth() { _ = resp } +func ExampleBackendServicesClient_GetIamPolicy() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetIamPolicyBackendServiceRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleBackendServicesClient_Insert() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. @@ -321,6 +346,31 @@ func ExampleBackendServicesClient_SetEdgeSecurityPolicy() { } } +func ExampleBackendServicesClient_SetIamPolicy() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetIamPolicyBackendServiceRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleBackendServicesClient_SetSecurityPolicy() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. diff --git a/compute/apiv1/gapic_metadata.json b/compute/apiv1/gapic_metadata.json index fac5f88daac..ae8339cae21 100644 --- a/compute/apiv1/gapic_metadata.json +++ b/compute/apiv1/gapic_metadata.json @@ -58,6 +58,11 @@ "methods": [ "List" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -196,6 +201,11 @@ "GetHealth" ] }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, "Insert": { "methods": [ "Insert" @@ -216,6 +226,11 @@ "SetEdgeSecurityPolicy" ] }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, "SetSecurityPolicy": { "methods": [ "SetSecurityPolicy" @@ -578,6 +593,11 @@ "methods": [ "List" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -1360,6 +1380,11 @@ "methods": [ "Patch" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -1418,6 +1443,11 @@ "methods": [ "Patch" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -2192,6 +2222,11 @@ "GetHealth" ] }, + "GetIamPolicy": { + "methods": [ + "GetIamPolicy" + ] + }, "Insert": { "methods": [ "Insert" @@ -2207,6 +2242,11 @@ "Patch" ] }, + "SetIamPolicy": { + "methods": [ + "SetIamPolicy" + ] + }, "Update": { "methods": [ "Update" @@ -2802,6 +2842,45 @@ } } }, + "RegionSslPolicies": { + "clients": { + "rest": { + "libraryClient": "RegionSslPoliciesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + }, + "ListAvailableFeatures": { + "methods": [ + "ListAvailableFeatures" + ] + }, + "Patch": { + "methods": [ + "Patch" + ] + } + } + } + } + }, "RegionTargetHttpProxies": { "clients": { "rest": { @@ -2880,6 +2959,35 @@ } } }, + "RegionTargetTcpProxies": { + "clients": { + "rest": { + "libraryClient": "RegionTargetTcpProxiesClient", + "rpcs": { + "Delete": { + "methods": [ + "Delete" + ] + }, + "Get": { + "methods": [ + "Get" + ] + }, + "Insert": { + "methods": [ + "Insert" + ] + }, + "List": { + "methods": [ + "List" + ] + } + } + } + } + }, "RegionUrlMaps": { "clients": { "rest": { @@ -3198,6 +3306,11 @@ "methods": [ "RemoveRule" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -3345,6 +3458,11 @@ "rest": { "libraryClient": "SslPoliciesClient", "rpcs": { + "AggregatedList": { + "methods": [ + "AggregatedList" + ] + }, "Delete": { "methods": [ "Delete" @@ -3810,6 +3928,11 @@ "methods": [ "List" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } @@ -3947,6 +4070,11 @@ "methods": [ "List" ] + }, + "SetLabels": { + "methods": [ + "SetLabels" + ] } } } diff --git a/compute/apiv1/global_addresses_client.go b/compute/apiv1/global_addresses_client.go index 5341627e754..4d25559917c 100644 --- a/compute/apiv1/global_addresses_client.go +++ b/compute/apiv1/global_addresses_client.go @@ -42,18 +42,20 @@ var newGlobalAddressesClientHook clientHook // GlobalAddressesCallOptions contains the retry settings for each method of GlobalAddressesClient. type GlobalAddressesCallOptions struct { - Delete []gax.CallOption - Get []gax.CallOption - Insert []gax.CallOption - List []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + SetLabels []gax.CallOption } func defaultGlobalAddressesRESTCallOptions() *GlobalAddressesCallOptions { return &GlobalAddressesCallOptions{ - Delete: []gax.CallOption{}, - Get: []gax.CallOption{}, - Insert: []gax.CallOption{}, - List: []gax.CallOption{}, + Delete: []gax.CallOption{}, + Get: []gax.CallOption{}, + Insert: []gax.CallOption{}, + List: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -66,6 +68,7 @@ type internalGlobalAddressesClient interface { Get(context.Context, *computepb.GetGlobalAddressRequest, ...gax.CallOption) (*computepb.Address, error) Insert(context.Context, *computepb.InsertGlobalAddressRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListGlobalAddressesRequest, ...gax.CallOption) *AddressIterator + SetLabels(context.Context, *computepb.SetLabelsGlobalAddressRequest, ...gax.CallOption) (*Operation, error) } // GlobalAddressesClient is a client for interacting with Google Compute Engine API. @@ -123,6 +126,11 @@ func (c *GlobalAddressesClient) List(ctx context.Context, req *computepb.ListGlo return c.internalClient.List(ctx, req, opts...) } +// SetLabels sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. +func (c *GlobalAddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type globalAddressesRESTClient struct { // The http endpoint to connect to. @@ -497,3 +505,70 @@ func (c *globalAddressesRESTClient) List(ctx context.Context, req *computepb.Lis return it } + +// SetLabels sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation. +func (c *globalAddressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses/%v/setLabels", req.GetProject(), req.GetResource()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + &globalOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + }, + } + return op, nil +} diff --git a/compute/apiv1/global_addresses_client_example_test.go b/compute/apiv1/global_addresses_client_example_test.go index f36aecd5624..2612e3c6f0a 100644 --- a/compute/apiv1/global_addresses_client_example_test.go +++ b/compute/apiv1/global_addresses_client_example_test.go @@ -152,3 +152,31 @@ func ExampleGlobalAddressesClient_List() { _ = resp } } + +func ExampleGlobalAddressesClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsGlobalAddressRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsGlobalAddressRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/interconnect_attachments_client.go b/compute/apiv1/interconnect_attachments_client.go index de0bfac3773..024bd08ed2d 100644 --- a/compute/apiv1/interconnect_attachments_client.go +++ b/compute/apiv1/interconnect_attachments_client.go @@ -49,6 +49,7 @@ type InterconnectAttachmentsCallOptions struct { Insert []gax.CallOption List []gax.CallOption Patch []gax.CallOption + SetLabels []gax.CallOption } func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCallOptions { @@ -59,6 +60,7 @@ func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCal Insert: []gax.CallOption{}, List: []gax.CallOption{}, Patch: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -73,6 +75,7 @@ type internalInterconnectAttachmentsClient interface { Insert(context.Context, *computepb.InsertInterconnectAttachmentRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListInterconnectAttachmentsRequest, ...gax.CallOption) *InterconnectAttachmentIterator Patch(context.Context, *computepb.PatchInterconnectAttachmentRequest, ...gax.CallOption) (*Operation, error) + SetLabels(context.Context, *computepb.SetLabelsInterconnectAttachmentRequest, ...gax.CallOption) (*Operation, error) } // InterconnectAttachmentsClient is a client for interacting with Google Compute Engine API. @@ -140,6 +143,11 @@ func (c *InterconnectAttachmentsClient) Patch(ctx context.Context, req *computep return c.internalClient.Patch(ctx, req, opts...) } +// SetLabels sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. +func (c *InterconnectAttachmentsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type interconnectAttachmentsRESTClient struct { // The http endpoint to connect to. @@ -701,6 +709,81 @@ func (c *interconnectAttachmentsRESTClient) Patch(ctx context.Context, req *comp return op, nil } +// SetLabels sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation. +func (c *interconnectAttachmentsRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectAttachmentRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/interconnectAttachments/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + // InterconnectAttachmentIterator manages a stream of *computepb.InterconnectAttachment. type InterconnectAttachmentIterator struct { items []*computepb.InterconnectAttachment diff --git a/compute/apiv1/interconnect_attachments_client_example_test.go b/compute/apiv1/interconnect_attachments_client_example_test.go index f841b0f9de4..c6ae6a79402 100644 --- a/compute/apiv1/interconnect_attachments_client_example_test.go +++ b/compute/apiv1/interconnect_attachments_client_example_test.go @@ -211,3 +211,31 @@ func ExampleInterconnectAttachmentsClient_Patch() { // TODO: Handle error. } } + +func ExampleInterconnectAttachmentsClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsInterconnectAttachmentRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/interconnects_client.go b/compute/apiv1/interconnects_client.go index e93375b0cf3..cc7eeed48c1 100644 --- a/compute/apiv1/interconnects_client.go +++ b/compute/apiv1/interconnects_client.go @@ -48,6 +48,7 @@ type InterconnectsCallOptions struct { Insert []gax.CallOption List []gax.CallOption Patch []gax.CallOption + SetLabels []gax.CallOption } func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions { @@ -58,6 +59,7 @@ func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions { Insert: []gax.CallOption{}, List: []gax.CallOption{}, Patch: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -72,6 +74,7 @@ type internalInterconnectsClient interface { Insert(context.Context, *computepb.InsertInterconnectRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListInterconnectsRequest, ...gax.CallOption) *InterconnectIterator Patch(context.Context, *computepb.PatchInterconnectRequest, ...gax.CallOption) (*Operation, error) + SetLabels(context.Context, *computepb.SetLabelsInterconnectRequest, ...gax.CallOption) (*Operation, error) } // InterconnectsClient is a client for interacting with Google Compute Engine API. @@ -139,6 +142,11 @@ func (c *InterconnectsClient) Patch(ctx context.Context, req *computepb.PatchInt return c.internalClient.Patch(ctx, req, opts...) } +// SetLabels sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. +func (c *InterconnectsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type interconnectsRESTClient struct { // The http endpoint to connect to. @@ -641,6 +649,73 @@ func (c *interconnectsRESTClient) Patch(ctx context.Context, req *computepb.Patc return op, nil } +// SetLabels sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation. +func (c *interconnectsRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsInterconnectRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v/setLabels", req.GetProject(), req.GetResource()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + &globalOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + }, + } + return op, nil +} + // InterconnectIterator manages a stream of *computepb.Interconnect. type InterconnectIterator struct { items []*computepb.Interconnect diff --git a/compute/apiv1/interconnects_client_example_test.go b/compute/apiv1/interconnects_client_example_test.go index 1e4055a68c6..4f273037501 100644 --- a/compute/apiv1/interconnects_client_example_test.go +++ b/compute/apiv1/interconnects_client_example_test.go @@ -205,3 +205,31 @@ func ExampleInterconnectsClient_Patch() { // TODO: Handle error. } } + +func ExampleInterconnectsClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsInterconnectRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsInterconnectRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/region_backend_services_client.go b/compute/apiv1/region_backend_services_client.go index 13ebb5a26a0..5096901779e 100644 --- a/compute/apiv1/region_backend_services_client.go +++ b/compute/apiv1/region_backend_services_client.go @@ -42,24 +42,28 @@ var newRegionBackendServicesClientHook clientHook // RegionBackendServicesCallOptions contains the retry settings for each method of RegionBackendServicesClient. type RegionBackendServicesCallOptions struct { - Delete []gax.CallOption - Get []gax.CallOption - GetHealth []gax.CallOption - Insert []gax.CallOption - List []gax.CallOption - Patch []gax.CallOption - Update []gax.CallOption + Delete []gax.CallOption + Get []gax.CallOption + GetHealth []gax.CallOption + GetIamPolicy []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + Patch []gax.CallOption + SetIamPolicy []gax.CallOption + Update []gax.CallOption } func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOptions { return &RegionBackendServicesCallOptions{ - Delete: []gax.CallOption{}, - Get: []gax.CallOption{}, - GetHealth: []gax.CallOption{}, - Insert: []gax.CallOption{}, - List: []gax.CallOption{}, - Patch: []gax.CallOption{}, - Update: []gax.CallOption{}, + Delete: []gax.CallOption{}, + Get: []gax.CallOption{}, + GetHealth: []gax.CallOption{}, + GetIamPolicy: []gax.CallOption{}, + Insert: []gax.CallOption{}, + List: []gax.CallOption{}, + Patch: []gax.CallOption{}, + SetIamPolicy: []gax.CallOption{}, + Update: []gax.CallOption{}, } } @@ -71,9 +75,11 @@ type internalRegionBackendServicesClient interface { Delete(context.Context, *computepb.DeleteRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error) Get(context.Context, *computepb.GetRegionBackendServiceRequest, ...gax.CallOption) (*computepb.BackendService, error) GetHealth(context.Context, *computepb.GetHealthRegionBackendServiceRequest, ...gax.CallOption) (*computepb.BackendServiceGroupHealth, error) + GetIamPolicy(context.Context, *computepb.GetIamPolicyRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error) Insert(context.Context, *computepb.InsertRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListRegionBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator Patch(context.Context, *computepb.PatchRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error) + SetIamPolicy(context.Context, *computepb.SetIamPolicyRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error) Update(context.Context, *computepb.UpdateRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error) } @@ -127,6 +133,11 @@ func (c *RegionBackendServicesClient) GetHealth(ctx context.Context, req *comput return c.internalClient.GetHealth(ctx, req, opts...) } +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *RegionBackendServicesClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.GetIamPolicy(ctx, req, opts...) +} + // Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview. func (c *RegionBackendServicesClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.Insert(ctx, req, opts...) @@ -142,6 +153,11 @@ func (c *RegionBackendServicesClient) Patch(ctx context.Context, req *computepb. return c.internalClient.Patch(ctx, req, opts...) } +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *RegionBackendServicesClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + return c.internalClient.SetIamPolicy(ctx, req, opts...) +} + // Update updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview . func (c *RegionBackendServicesClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.Update(ctx, req, opts...) @@ -413,6 +429,66 @@ func (c *regionBackendServicesRESTClient) GetHealth(ctx context.Context, req *co return resp, nil } +// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists. +func (c *regionBackendServicesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v/getIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.OptionsRequestedPolicyVersion != nil { + params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, 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. func (c *regionBackendServicesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} @@ -659,6 +735,66 @@ func (c *regionBackendServicesRESTClient) Patch(ctx context.Context, req *comput return op, nil } +// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy. +func (c *regionBackendServicesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.Policy, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetRegionSetPolicyRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/backendServices/%v/setIamPolicy", req.GetProject(), req.GetRegion(), req.GetResource()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Policy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + // Update updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview . func (c *regionBackendServicesRESTClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} diff --git a/compute/apiv1/region_backend_services_client_example_test.go b/compute/apiv1/region_backend_services_client_example_test.go index 9e837e3d6e2..32256dbd3d5 100644 --- a/compute/apiv1/region_backend_services_client_example_test.go +++ b/compute/apiv1/region_backend_services_client_example_test.go @@ -119,6 +119,31 @@ func ExampleRegionBackendServicesClient_GetHealth() { _ = resp } +func ExampleRegionBackendServicesClient_GetIamPolicy() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetIamPolicyRegionBackendServiceRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleRegionBackendServicesClient_Insert() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. @@ -206,6 +231,31 @@ func ExampleRegionBackendServicesClient_Patch() { } } +func ExampleRegionBackendServicesClient_SetIamPolicy() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetIamPolicyRegionBackendServiceRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + func ExampleRegionBackendServicesClient_Update() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. diff --git a/compute/apiv1/region_ssl_policies_client.go b/compute/apiv1/region_ssl_policies_client.go new file mode 100644 index 00000000000..05c5109662f --- /dev/null +++ b/compute/apiv1/region_ssl_policies_client.go @@ -0,0 +1,711 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package compute + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "math" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newRegionSslPoliciesClientHook clientHook + +// RegionSslPoliciesCallOptions contains the retry settings for each method of RegionSslPoliciesClient. +type RegionSslPoliciesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption + ListAvailableFeatures []gax.CallOption + Patch []gax.CallOption +} + +func defaultRegionSslPoliciesRESTCallOptions() *RegionSslPoliciesCallOptions { + return &RegionSslPoliciesCallOptions{ + Delete: []gax.CallOption{}, + Get: []gax.CallOption{}, + Insert: []gax.CallOption{}, + List: []gax.CallOption{}, + ListAvailableFeatures: []gax.CallOption{}, + Patch: []gax.CallOption{}, + } +} + +// internalRegionSslPoliciesClient is an interface that defines the methods available from Google Compute Engine API. +type internalRegionSslPoliciesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionSslPolicyRequest, ...gax.CallOption) (*Operation, error) + Get(context.Context, *computepb.GetRegionSslPolicyRequest, ...gax.CallOption) (*computepb.SslPolicy, error) + Insert(context.Context, *computepb.InsertRegionSslPolicyRequest, ...gax.CallOption) (*Operation, error) + List(context.Context, *computepb.ListRegionSslPoliciesRequest, ...gax.CallOption) *SslPolicyIterator + ListAvailableFeatures(context.Context, *computepb.ListAvailableFeaturesRegionSslPoliciesRequest, ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) + Patch(context.Context, *computepb.PatchRegionSslPolicyRequest, ...gax.CallOption) (*Operation, error) +} + +// RegionSslPoliciesClient is a client for interacting with Google Compute Engine API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// The RegionSslPolicies API. +type RegionSslPoliciesClient struct { + // The internal transport-dependent client. + internalClient internalRegionSslPoliciesClient + + // The call options for this service. + CallOptions *RegionSslPoliciesCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *RegionSslPoliciesClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *RegionSslPoliciesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *RegionSslPoliciesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. +func (c *RegionSslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get lists all of the ordered rules present in a single specified policy. +func (c *RegionSslPoliciesClient) Get(ctx context.Context, req *computepb.GetRegionSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a new policy in the specified project and region using the data included in the request. +func (c *RegionSslPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List lists all the SSL policies that have been configured for the specified project and region. +func (c *RegionSslPoliciesClient) List(ctx context.Context, req *computepb.ListRegionSslPoliciesRequest, opts ...gax.CallOption) *SslPolicyIterator { + return c.internalClient.List(ctx, req, opts...) +} + +// ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile. +func (c *RegionSslPoliciesClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesRegionSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) { + return c.internalClient.ListAvailableFeatures(ctx, req, opts...) +} + +// Patch patches the specified SSL policy with the data included in the request. +func (c *RegionSslPoliciesClient) Patch(ctx context.Context, req *computepb.PatchRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.Patch(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionSslPoliciesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // operationClient is used to call the operation-specific management service. + operationClient *RegionOperationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD + + // Points back to the CallOptions field of the containing RegionSslPoliciesClient + CallOptions **RegionSslPoliciesCallOptions +} + +// NewRegionSslPoliciesRESTClient creates a new region ssl policies rest client. +// +// The RegionSslPolicies API. +func NewRegionSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionSslPoliciesClient, error) { + clientOpts := append(defaultRegionSslPoliciesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultRegionSslPoliciesRESTCallOptions() + c := ®ionSslPoliciesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + o := []option.ClientOption{ + option.WithHTTPClient(httpClient), + option.WithEndpoint(endpoint), + } + opC, err := NewRegionOperationsRESTClient(ctx, o...) + if err != nil { + return nil, err + } + c.operationClient = opC + + return &RegionSslPoliciesClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultRegionSslPoliciesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionSslPoliciesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionSslPoliciesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + if err := c.operationClient.Close(); err != nil { + return err + } + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *regionSslPoliciesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. +func (c *regionSslPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies/%v", req.GetProject(), req.GetRegion(), req.GetSslPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "ssl_policy", url.QueryEscape(req.GetSslPolicy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Delete[0:len((*c.CallOptions).Delete):len((*c.CallOptions).Delete)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + +// Get lists all of the ordered rules present in a single specified policy. +func (c *regionSslPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetRegionSslPolicyRequest, opts ...gax.CallOption) (*computepb.SslPolicy, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies/%v", req.GetProject(), req.GetRegion(), req.GetSslPolicy()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "ssl_policy", url.QueryEscape(req.GetSslPolicy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Get[0:len((*c.CallOptions).Get):len((*c.CallOptions).Get)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.SslPolicy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// Insert creates a new policy in the specified project and region using the data included in the request. +func (c *regionSslPoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetSslPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Insert[0:len((*c.CallOptions).Insert):len((*c.CallOptions).Insert)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + +// List lists all the SSL policies that have been configured for the specified project and region. +func (c *regionSslPoliciesRESTClient) List(ctx context.Context, req *computepb.ListRegionSslPoliciesRequest, opts ...gax.CallOption) *SslPolicyIterator { + it := &SslPolicyIterator{} + req = proto.Clone(req).(*computepb.ListRegionSslPoliciesRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.SslPolicy, string, error) { + resp := &computepb.SslPoliciesList{} + if pageToken != "" { + req.PageToken = proto.String(pageToken) + } + if pageSize > math.MaxInt32 { + req.MaxResults = proto.Uint32(math.MaxInt32) + } else if pageSize != 0 { + req.MaxResults = proto.Uint32(uint32(pageSize)) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.MaxResults != nil { + params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults())) + } + if req != nil && req.OrderBy != nil { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req != nil && req.PageToken != nil { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetItems(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetMaxResults()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +// ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile. +func (c *regionSslPoliciesRESTClient) ListAvailableFeatures(ctx context.Context, req *computepb.ListAvailableFeaturesRegionSslPoliciesRequest, opts ...gax.CallOption) (*computepb.SslPoliciesListAvailableFeaturesResponse, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies/listAvailableFeatures", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.MaxResults != nil { + params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults())) + } + if req != nil && req.OrderBy != nil { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req != nil && req.PageToken != nil { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).ListAvailableFeatures[0:len((*c.CallOptions).ListAvailableFeatures):len((*c.CallOptions).ListAvailableFeatures)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.SslPoliciesListAvailableFeaturesResponse{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// Patch patches the specified SSL policy with the data included in the request. +func (c *regionSslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetSslPolicyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/sslPolicies/%v", req.GetProject(), req.GetRegion(), req.GetSslPolicy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "ssl_policy", url.QueryEscape(req.GetSslPolicy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Patch[0:len((*c.CallOptions).Patch):len((*c.CallOptions).Patch)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("PATCH", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + +// SslPolicyIterator manages a stream of *computepb.SslPolicy. +type SslPolicyIterator struct { + items []*computepb.SslPolicy + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*computepb.SslPolicy, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *SslPolicyIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *SslPolicyIterator) Next() (*computepb.SslPolicy, error) { + var item *computepb.SslPolicy + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *SslPolicyIterator) bufLen() int { + return len(it.items) +} + +func (it *SslPolicyIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/compute/apiv1/region_ssl_policies_client_example_test.go b/compute/apiv1/region_ssl_policies_client_example_test.go new file mode 100644 index 00000000000..9c34f825aa0 --- /dev/null +++ b/compute/apiv1/region_ssl_policies_client_example_test.go @@ -0,0 +1,207 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package compute_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + "google.golang.org/api/iterator" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionSslPoliciesRESTClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionSslPoliciesClient_Delete() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteRegionSslPolicyRequest. + } + op, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleRegionSslPoliciesClient_Get() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetRegionSslPolicyRequest. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionSslPoliciesClient_Insert() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertRegionSslPolicyRequest. + } + op, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleRegionSslPoliciesClient_List() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListRegionSslPoliciesRequest. + } + it := c.List(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +func ExampleRegionSslPoliciesClient_ListAvailableFeatures() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAvailableFeaturesRegionSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListAvailableFeaturesRegionSslPoliciesRequest. + } + resp, err := c.ListAvailableFeatures(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionSslPoliciesClient_Patch() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#PatchRegionSslPolicyRequest. + } + op, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/region_target_tcp_proxies_client.go b/compute/apiv1/region_target_tcp_proxies_client.go new file mode 100644 index 00000000000..e6233fc622c --- /dev/null +++ b/compute/apiv1/region_target_tcp_proxies_client.go @@ -0,0 +1,548 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package compute + +import ( + "bytes" + "context" + "fmt" + "io/ioutil" + "math" + "net/http" + "net/url" + + gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" + "google.golang.org/api/iterator" + "google.golang.org/api/option" + "google.golang.org/api/option/internaloption" + httptransport "google.golang.org/api/transport/http" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/metadata" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var newRegionTargetTcpProxiesClientHook clientHook + +// RegionTargetTcpProxiesCallOptions contains the retry settings for each method of RegionTargetTcpProxiesClient. +type RegionTargetTcpProxiesCallOptions struct { + Delete []gax.CallOption + Get []gax.CallOption + Insert []gax.CallOption + List []gax.CallOption +} + +func defaultRegionTargetTcpProxiesRESTCallOptions() *RegionTargetTcpProxiesCallOptions { + return &RegionTargetTcpProxiesCallOptions{ + Delete: []gax.CallOption{}, + Get: []gax.CallOption{}, + Insert: []gax.CallOption{}, + List: []gax.CallOption{}, + } +} + +// internalRegionTargetTcpProxiesClient is an interface that defines the methods available from Google Compute Engine API. +type internalRegionTargetTcpProxiesClient interface { + Close() error + setGoogleClientInfo(...string) + Connection() *grpc.ClientConn + Delete(context.Context, *computepb.DeleteRegionTargetTcpProxyRequest, ...gax.CallOption) (*Operation, error) + Get(context.Context, *computepb.GetRegionTargetTcpProxyRequest, ...gax.CallOption) (*computepb.TargetTcpProxy, error) + Insert(context.Context, *computepb.InsertRegionTargetTcpProxyRequest, ...gax.CallOption) (*Operation, error) + List(context.Context, *computepb.ListRegionTargetTcpProxiesRequest, ...gax.CallOption) *TargetTcpProxyIterator +} + +// RegionTargetTcpProxiesClient is a client for interacting with Google Compute Engine API. +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +// +// The RegionTargetTcpProxies API. +type RegionTargetTcpProxiesClient struct { + // The internal transport-dependent client. + internalClient internalRegionTargetTcpProxiesClient + + // The call options for this service. + CallOptions *RegionTargetTcpProxiesCallOptions +} + +// Wrapper methods routed to the internal client. + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *RegionTargetTcpProxiesClient) Close() error { + return c.internalClient.Close() +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *RegionTargetTcpProxiesClient) setGoogleClientInfo(keyval ...string) { + c.internalClient.setGoogleClientInfo(keyval...) +} + +// Connection returns a connection to the API service. +// +// Deprecated: Connections are now pooled so this method does not always +// return the same resource. +func (c *RegionTargetTcpProxiesClient) Connection() *grpc.ClientConn { + return c.internalClient.Connection() +} + +// Delete deletes the specified TargetTcpProxy resource. +func (c *RegionTargetTcpProxiesClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.Delete(ctx, req, opts...) +} + +// Get returns the specified TargetTcpProxy resource. +func (c *RegionTargetTcpProxiesClient) Get(ctx context.Context, req *computepb.GetRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error) { + return c.internalClient.Get(ctx, req, opts...) +} + +// Insert creates a TargetTcpProxy resource in the specified project and region using the data included in the request. +func (c *RegionTargetTcpProxiesClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.Insert(ctx, req, opts...) +} + +// List retrieves a list of TargetTcpProxy resources available to the specified project in a given region. +func (c *RegionTargetTcpProxiesClient) List(ctx context.Context, req *computepb.ListRegionTargetTcpProxiesRequest, opts ...gax.CallOption) *TargetTcpProxyIterator { + return c.internalClient.List(ctx, req, opts...) +} + +// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. +type regionTargetTcpProxiesRESTClient struct { + // The http endpoint to connect to. + endpoint string + + // The http client. + httpClient *http.Client + + // operationClient is used to call the operation-specific management service. + operationClient *RegionOperationsClient + + // The x-goog-* metadata to be sent with each request. + xGoogMetadata metadata.MD + + // Points back to the CallOptions field of the containing RegionTargetTcpProxiesClient + CallOptions **RegionTargetTcpProxiesCallOptions +} + +// NewRegionTargetTcpProxiesRESTClient creates a new region target tcp proxies rest client. +// +// The RegionTargetTcpProxies API. +func NewRegionTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.ClientOption) (*RegionTargetTcpProxiesClient, error) { + clientOpts := append(defaultRegionTargetTcpProxiesRESTClientOptions(), opts...) + httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...) + if err != nil { + return nil, err + } + + callOpts := defaultRegionTargetTcpProxiesRESTCallOptions() + c := ®ionTargetTcpProxiesRESTClient{ + endpoint: endpoint, + httpClient: httpClient, + CallOptions: &callOpts, + } + c.setGoogleClientInfo() + + o := []option.ClientOption{ + option.WithHTTPClient(httpClient), + option.WithEndpoint(endpoint), + } + opC, err := NewRegionOperationsRESTClient(ctx, o...) + if err != nil { + return nil, err + } + c.operationClient = opC + + return &RegionTargetTcpProxiesClient{internalClient: c, CallOptions: callOpts}, nil +} + +func defaultRegionTargetTcpProxiesRESTClientOptions() []option.ClientOption { + return []option.ClientOption{ + internaloption.WithDefaultEndpoint("https://compute.googleapis.com"), + internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"), + internaloption.WithDefaultAudience("https://compute.googleapis.com/"), + internaloption.WithDefaultScopes(DefaultAuthScopes()...), + } +} + +// setGoogleClientInfo sets the name and version of the application in +// the `x-goog-api-client` header passed on each request. Intended for +// use by Google-written clients. +func (c *regionTargetTcpProxiesRESTClient) setGoogleClientInfo(keyval ...string) { + kv := append([]string{"gl-go", versionGo()}, keyval...) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN") + c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...)) +} + +// Close closes the connection to the API service. The user should invoke this when +// the client is no longer required. +func (c *regionTargetTcpProxiesRESTClient) Close() error { + // Replace httpClient with nil to force cleanup. + c.httpClient = nil + if err := c.operationClient.Close(); err != nil { + return err + } + return nil +} + +// Connection returns a connection to the API service. +// +// Deprecated: This method always returns nil. +func (c *regionTargetTcpProxiesRESTClient) Connection() *grpc.ClientConn { + return nil +} + +// Delete deletes the specified TargetTcpProxy resource. +func (c *regionTargetTcpProxiesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetTcpProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetTcpProxy()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "target_tcp_proxy", url.QueryEscape(req.GetTargetTcpProxy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Delete[0:len((*c.CallOptions).Delete):len((*c.CallOptions).Delete)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("DELETE", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + +// Get returns the specified TargetTcpProxy resource. +func (c *regionTargetTcpProxiesRESTClient) Get(ctx context.Context, req *computepb.GetRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*computepb.TargetTcpProxy, error) { + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetTcpProxies/%v", req.GetProject(), req.GetRegion(), req.GetTargetTcpProxy()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "target_tcp_proxy", url.QueryEscape(req.GetTargetTcpProxy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Get[0:len((*c.CallOptions).Get):len((*c.CallOptions).Get)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.TargetTcpProxy{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + return resp, nil +} + +// Insert creates a TargetTcpProxy resource in the specified project and region using the data included in the request. +func (c *regionTargetTcpProxiesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionTargetTcpProxyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetTargetTcpProxyResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetTcpProxies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).Insert[0:len((*c.CallOptions).Insert):len((*c.CallOptions).Insert)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + +// List retrieves a list of TargetTcpProxy resources available to the specified project in a given region. +func (c *regionTargetTcpProxiesRESTClient) List(ctx context.Context, req *computepb.ListRegionTargetTcpProxiesRequest, opts ...gax.CallOption) *TargetTcpProxyIterator { + it := &TargetTcpProxyIterator{} + req = proto.Clone(req).(*computepb.ListRegionTargetTcpProxiesRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.TargetTcpProxy, string, error) { + resp := &computepb.TargetTcpProxyList{} + if pageToken != "" { + req.PageToken = proto.String(pageToken) + } + if pageSize > math.MaxInt32 { + req.MaxResults = proto.Uint32(math.MaxInt32) + } else if pageSize != 0 { + req.MaxResults = proto.Uint32(uint32(pageSize)) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetTcpProxies", req.GetProject(), req.GetRegion()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.MaxResults != nil { + params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults())) + } + if req != nil && req.OrderBy != nil { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req != nil && req.PageToken != nil { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + return resp.GetItems(), resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetMaxResults()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + +// TargetTcpProxyIterator manages a stream of *computepb.TargetTcpProxy. +type TargetTcpProxyIterator struct { + items []*computepb.TargetTcpProxy + pageInfo *iterator.PageInfo + nextFunc func() error + + // Response is the raw response for the current page. + // It must be cast to the RPC response type. + // Calling Next() or InternalFetch() updates this value. + Response interface{} + + // InternalFetch is for use by the Google Cloud Libraries only. + // It is not part of the stable interface of this package. + // + // InternalFetch returns results from a single call to the underlying RPC. + // The number of results is no greater than pageSize. + // If there are no more results, nextPageToken is empty and err is nil. + InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetTcpProxy, nextPageToken string, err error) +} + +// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. +func (it *TargetTcpProxyIterator) PageInfo() *iterator.PageInfo { + return it.pageInfo +} + +// Next returns the next result. Its second return value is iterator.Done if there are no more +// results. Once Next returns Done, all subsequent calls will return Done. +func (it *TargetTcpProxyIterator) Next() (*computepb.TargetTcpProxy, error) { + var item *computepb.TargetTcpProxy + if err := it.nextFunc(); err != nil { + return item, err + } + item = it.items[0] + it.items = it.items[1:] + return item, nil +} + +func (it *TargetTcpProxyIterator) bufLen() int { + return len(it.items) +} + +func (it *TargetTcpProxyIterator) takeBuf() interface{} { + b := it.items + it.items = nil + return b +} diff --git a/compute/apiv1/region_target_tcp_proxies_client_example_test.go b/compute/apiv1/region_target_tcp_proxies_client_example_test.go new file mode 100644 index 00000000000..2c71acdbaa4 --- /dev/null +++ b/compute/apiv1/region_target_tcp_proxies_client_example_test.go @@ -0,0 +1,154 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go_gapic. DO NOT EDIT. + +package compute_test + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + "google.golang.org/api/iterator" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func ExampleNewRegionTargetTcpProxiesRESTClient() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + // TODO: Use client. + _ = c +} + +func ExampleRegionTargetTcpProxiesClient_Delete() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteRegionTargetTcpProxyRequest. + } + op, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleRegionTargetTcpProxiesClient_Get() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetRegionTargetTcpProxyRequest. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +func ExampleRegionTargetTcpProxiesClient_Insert() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertRegionTargetTcpProxyRequest. + } + op, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +func ExampleRegionTargetTcpProxiesClient_List() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionTargetTcpProxiesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListRegionTargetTcpProxiesRequest. + } + it := c.List(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} diff --git a/compute/apiv1/security_policies_client.go b/compute/apiv1/security_policies_client.go index 63356cc9341..9d9c6656438 100644 --- a/compute/apiv1/security_policies_client.go +++ b/compute/apiv1/security_policies_client.go @@ -54,6 +54,7 @@ type SecurityPoliciesCallOptions struct { Patch []gax.CallOption PatchRule []gax.CallOption RemoveRule []gax.CallOption + SetLabels []gax.CallOption } func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions { @@ -69,6 +70,7 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions { Patch: []gax.CallOption{}, PatchRule: []gax.CallOption{}, RemoveRule: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -88,6 +90,7 @@ type internalSecurityPoliciesClient interface { Patch(context.Context, *computepb.PatchSecurityPolicyRequest, ...gax.CallOption) (*Operation, error) PatchRule(context.Context, *computepb.PatchRuleSecurityPolicyRequest, ...gax.CallOption) (*Operation, error) RemoveRule(context.Context, *computepb.RemoveRuleSecurityPolicyRequest, ...gax.CallOption) (*Operation, error) + SetLabels(context.Context, *computepb.SetLabelsSecurityPolicyRequest, ...gax.CallOption) (*Operation, error) } // SecurityPoliciesClient is a client for interacting with Google Compute Engine API. @@ -180,6 +183,11 @@ func (c *SecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb. return c.internalClient.RemoveRule(ctx, req, opts...) } +// SetLabels sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. +func (c *SecurityPoliciesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type securityPoliciesRESTClient struct { // The http endpoint to connect to. @@ -1088,6 +1096,73 @@ func (c *securityPoliciesRESTClient) RemoveRule(ctx context.Context, req *comput return op, nil } +// SetLabels sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation. +func (c *securityPoliciesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetGlobalSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/setLabels", req.GetProject(), req.GetResource()) + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + &globalOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + }, + } + return op, nil +} + // SecurityPoliciesScopedListPair is a holder type for string/*computepb.SecurityPoliciesScopedList map entries type SecurityPoliciesScopedListPair struct { Key string diff --git a/compute/apiv1/security_policies_client_example_test.go b/compute/apiv1/security_policies_client_example_test.go index feb127a98b0..00d3453ab54 100644 --- a/compute/apiv1/security_policies_client_example_test.go +++ b/compute/apiv1/security_policies_client_example_test.go @@ -345,3 +345,31 @@ func ExampleSecurityPoliciesClient_RemoveRule() { // TODO: Handle error. } } + +func ExampleSecurityPoliciesClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsSecurityPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsSecurityPolicyRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/ssl_policies_client.go b/compute/apiv1/ssl_policies_client.go index 06abd18e284..63081fa1e18 100644 --- a/compute/apiv1/ssl_policies_client.go +++ b/compute/apiv1/ssl_policies_client.go @@ -24,6 +24,7 @@ import ( "math" "net/http" "net/url" + "sort" gax "github.com/googleapis/gax-go/v2" "google.golang.org/api/googleapi" @@ -42,6 +43,7 @@ var newSslPoliciesClientHook clientHook // SslPoliciesCallOptions contains the retry settings for each method of SslPoliciesClient. type SslPoliciesCallOptions struct { + AggregatedList []gax.CallOption Delete []gax.CallOption Get []gax.CallOption Insert []gax.CallOption @@ -52,6 +54,7 @@ type SslPoliciesCallOptions struct { func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions { return &SslPoliciesCallOptions{ + AggregatedList: []gax.CallOption{}, Delete: []gax.CallOption{}, Get: []gax.CallOption{}, Insert: []gax.CallOption{}, @@ -66,6 +69,7 @@ type internalSslPoliciesClient interface { Close() error setGoogleClientInfo(...string) Connection() *grpc.ClientConn + AggregatedList(context.Context, *computepb.AggregatedListSslPoliciesRequest, ...gax.CallOption) *SslPoliciesScopedListPairIterator Delete(context.Context, *computepb.DeleteSslPolicyRequest, ...gax.CallOption) (*Operation, error) Get(context.Context, *computepb.GetSslPolicyRequest, ...gax.CallOption) (*computepb.SslPolicy, error) Insert(context.Context, *computepb.InsertSslPolicyRequest, ...gax.CallOption) (*Operation, error) @@ -109,6 +113,11 @@ func (c *SslPoliciesClient) Connection() *grpc.ClientConn { return c.internalClient.Connection() } +// AggregatedList retrieves the list of all SslPolicy resources, regional and global, available to the specified project. +func (c *SslPoliciesClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslPoliciesRequest, opts ...gax.CallOption) *SslPoliciesScopedListPairIterator { + return c.internalClient.AggregatedList(ctx, req, opts...) +} + // Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. func (c *SslPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.Delete(ctx, req, opts...) @@ -224,6 +233,112 @@ func (c *sslPoliciesRESTClient) Connection() *grpc.ClientConn { return nil } +// AggregatedList retrieves the list of all SslPolicy resources, regional and global, available to the specified project. +func (c *sslPoliciesRESTClient) AggregatedList(ctx context.Context, req *computepb.AggregatedListSslPoliciesRequest, opts ...gax.CallOption) *SslPoliciesScopedListPairIterator { + it := &SslPoliciesScopedListPairIterator{} + req = proto.Clone(req).(*computepb.AggregatedListSslPoliciesRequest) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + it.InternalFetch = func(pageSize int, pageToken string) ([]SslPoliciesScopedListPair, string, error) { + resp := &computepb.SslPoliciesAggregatedList{} + if pageToken != "" { + req.PageToken = proto.String(pageToken) + } + if pageSize > math.MaxInt32 { + req.MaxResults = proto.Uint32(math.MaxInt32) + } else if pageSize != 0 { + req.MaxResults = proto.Uint32(uint32(pageSize)) + } + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, "", err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/aggregated/sslPolicies", req.GetProject()) + + params := url.Values{} + if req != nil && req.Filter != nil { + params.Add("filter", fmt.Sprintf("%v", req.GetFilter())) + } + if req != nil && req.IncludeAllScopes != nil { + params.Add("includeAllScopes", fmt.Sprintf("%v", req.GetIncludeAllScopes())) + } + if req != nil && req.MaxResults != nil { + params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults())) + } + if req != nil && req.OrderBy != nil { + params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy())) + } + if req != nil && req.PageToken != nil { + params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken())) + } + if req != nil && req.ReturnPartialSuccess != nil { + params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json")) + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("GET", baseUrl.String(), nil) + if err != nil { + return err + } + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, "", e + } + it.Response = resp + + elems := make([]SslPoliciesScopedListPair, 0, len(resp.GetItems())) + for k, v := range resp.GetItems() { + elems = append(elems, SslPoliciesScopedListPair{k, v}) + } + sort.Slice(elems, func(i, j int) bool { return elems[i].Key < elems[j].Key }) + + return elems, resp.GetNextPageToken(), nil + } + + fetch := func(pageSize int, pageToken string) (string, error) { + items, nextPageToken, err := it.InternalFetch(pageSize, pageToken) + if err != nil { + return "", err + } + it.items = append(it.items, items...) + return nextPageToken, nil + } + + it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf) + it.pageInfo.MaxSize = int(req.GetMaxResults()) + it.pageInfo.Token = req.GetPageToken() + + return it +} + // Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources. func (c *sslPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteSslPolicyRequest, opts ...gax.CallOption) (*Operation, error) { baseUrl, err := url.Parse(c.endpoint) @@ -660,9 +775,15 @@ func (c *sslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchS return op, nil } -// SslPolicyIterator manages a stream of *computepb.SslPolicy. -type SslPolicyIterator struct { - items []*computepb.SslPolicy +// SslPoliciesScopedListPair is a holder type for string/*computepb.SslPoliciesScopedList map entries +type SslPoliciesScopedListPair struct { + Key string + Value *computepb.SslPoliciesScopedList +} + +// SslPoliciesScopedListPairIterator manages a stream of SslPoliciesScopedListPair. +type SslPoliciesScopedListPairIterator struct { + items []SslPoliciesScopedListPair pageInfo *iterator.PageInfo nextFunc func() error @@ -677,18 +798,18 @@ type SslPolicyIterator struct { // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*computepb.SslPolicy, nextPageToken string, err error) + InternalFetch func(pageSize int, pageToken string) (results []SslPoliciesScopedListPair, nextPageToken string, err error) } // PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *SslPolicyIterator) PageInfo() *iterator.PageInfo { +func (it *SslPoliciesScopedListPairIterator) PageInfo() *iterator.PageInfo { return it.pageInfo } // Next returns the next result. Its second return value is iterator.Done if there are no more // results. Once Next returns Done, all subsequent calls will return Done. -func (it *SslPolicyIterator) Next() (*computepb.SslPolicy, error) { - var item *computepb.SslPolicy +func (it *SslPoliciesScopedListPairIterator) Next() (SslPoliciesScopedListPair, error) { + var item SslPoliciesScopedListPair if err := it.nextFunc(); err != nil { return item, err } @@ -697,11 +818,11 @@ func (it *SslPolicyIterator) Next() (*computepb.SslPolicy, error) { return item, nil } -func (it *SslPolicyIterator) bufLen() int { +func (it *SslPoliciesScopedListPairIterator) bufLen() int { return len(it.items) } -func (it *SslPolicyIterator) takeBuf() interface{} { +func (it *SslPoliciesScopedListPairIterator) takeBuf() interface{} { b := it.items it.items = nil return b diff --git a/compute/apiv1/ssl_policies_client_example_test.go b/compute/apiv1/ssl_policies_client_example_test.go index 899348da36d..4bc699a5b9c 100644 --- a/compute/apiv1/ssl_policies_client_example_test.go +++ b/compute/apiv1/ssl_policies_client_example_test.go @@ -41,6 +41,37 @@ func ExampleNewSslPoliciesRESTClient() { _ = c } +func ExampleSslPoliciesClient_AggregatedList() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListSslPoliciesRequest. + } + it := c.AggregatedList(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + func ExampleSslPoliciesClient_Delete() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. diff --git a/compute/apiv1/target_tcp_proxies_client.go b/compute/apiv1/target_tcp_proxies_client.go index f46cf90c6e5..74b4b11a923 100644 --- a/compute/apiv1/target_tcp_proxies_client.go +++ b/compute/apiv1/target_tcp_proxies_client.go @@ -661,50 +661,3 @@ func (c *targetTcpProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co } return op, nil } - -// TargetTcpProxyIterator manages a stream of *computepb.TargetTcpProxy. -type TargetTcpProxyIterator struct { - items []*computepb.TargetTcpProxy - pageInfo *iterator.PageInfo - nextFunc func() error - - // Response is the raw response for the current page. - // It must be cast to the RPC response type. - // Calling Next() or InternalFetch() updates this value. - Response interface{} - - // InternalFetch is for use by the Google Cloud Libraries only. - // It is not part of the stable interface of this package. - // - // InternalFetch returns results from a single call to the underlying RPC. - // The number of results is no greater than pageSize. - // If there are no more results, nextPageToken is empty and err is nil. - InternalFetch func(pageSize int, pageToken string) (results []*computepb.TargetTcpProxy, nextPageToken string, err error) -} - -// PageInfo supports pagination. See the google.golang.org/api/iterator package for details. -func (it *TargetTcpProxyIterator) PageInfo() *iterator.PageInfo { - return it.pageInfo -} - -// Next returns the next result. Its second return value is iterator.Done if there are no more -// results. Once Next returns Done, all subsequent calls will return Done. -func (it *TargetTcpProxyIterator) Next() (*computepb.TargetTcpProxy, error) { - var item *computepb.TargetTcpProxy - if err := it.nextFunc(); err != nil { - return item, err - } - item = it.items[0] - it.items = it.items[1:] - return item, nil -} - -func (it *TargetTcpProxyIterator) bufLen() int { - return len(it.items) -} - -func (it *TargetTcpProxyIterator) takeBuf() interface{} { - b := it.items - it.items = nil - return b -} diff --git a/compute/apiv1/target_vpn_gateways_client.go b/compute/apiv1/target_vpn_gateways_client.go index 1c5dd8368b5..8c91a836ad4 100644 --- a/compute/apiv1/target_vpn_gateways_client.go +++ b/compute/apiv1/target_vpn_gateways_client.go @@ -48,6 +48,7 @@ type TargetVpnGatewaysCallOptions struct { Get []gax.CallOption Insert []gax.CallOption List []gax.CallOption + SetLabels []gax.CallOption } func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions { @@ -57,6 +58,7 @@ func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions { Get: []gax.CallOption{}, Insert: []gax.CallOption{}, List: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -70,6 +72,7 @@ type internalTargetVpnGatewaysClient interface { Get(context.Context, *computepb.GetTargetVpnGatewayRequest, ...gax.CallOption) (*computepb.TargetVpnGateway, error) Insert(context.Context, *computepb.InsertTargetVpnGatewayRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListTargetVpnGatewaysRequest, ...gax.CallOption) *TargetVpnGatewayIterator + SetLabels(context.Context, *computepb.SetLabelsTargetVpnGatewayRequest, ...gax.CallOption) (*Operation, error) } // TargetVpnGatewaysClient is a client for interacting with Google Compute Engine API. @@ -132,6 +135,11 @@ func (c *TargetVpnGatewaysClient) List(ctx context.Context, req *computepb.ListT return c.internalClient.List(ctx, req, opts...) } +// SetLabels sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *TargetVpnGatewaysClient) SetLabels(ctx context.Context, req *computepb.SetLabelsTargetVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type targetVpnGatewaysRESTClient struct { // The http endpoint to connect to. @@ -615,6 +623,81 @@ func (c *targetVpnGatewaysRESTClient) List(ctx context.Context, req *computepb.L return it } +// SetLabels sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation. +func (c *targetVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsTargetVpnGatewayRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetVpnGateways/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + // TargetVpnGatewayIterator manages a stream of *computepb.TargetVpnGateway. type TargetVpnGatewayIterator struct { items []*computepb.TargetVpnGateway diff --git a/compute/apiv1/target_vpn_gateways_client_example_test.go b/compute/apiv1/target_vpn_gateways_client_example_test.go index eafaa20f5f2..82fb32446ba 100644 --- a/compute/apiv1/target_vpn_gateways_client_example_test.go +++ b/compute/apiv1/target_vpn_gateways_client_example_test.go @@ -183,3 +183,31 @@ func ExampleTargetVpnGatewaysClient_List() { _ = resp } } + +func ExampleTargetVpnGatewaysClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsTargetVpnGatewayRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsTargetVpnGatewayRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/apiv1/vpn_tunnels_client.go b/compute/apiv1/vpn_tunnels_client.go index ab26a7a36a5..3cf65e51415 100644 --- a/compute/apiv1/vpn_tunnels_client.go +++ b/compute/apiv1/vpn_tunnels_client.go @@ -48,6 +48,7 @@ type VpnTunnelsCallOptions struct { Get []gax.CallOption Insert []gax.CallOption List []gax.CallOption + SetLabels []gax.CallOption } func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions { @@ -57,6 +58,7 @@ func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions { Get: []gax.CallOption{}, Insert: []gax.CallOption{}, List: []gax.CallOption{}, + SetLabels: []gax.CallOption{}, } } @@ -70,6 +72,7 @@ type internalVpnTunnelsClient interface { Get(context.Context, *computepb.GetVpnTunnelRequest, ...gax.CallOption) (*computepb.VpnTunnel, error) Insert(context.Context, *computepb.InsertVpnTunnelRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListVpnTunnelsRequest, ...gax.CallOption) *VpnTunnelIterator + SetLabels(context.Context, *computepb.SetLabelsVpnTunnelRequest, ...gax.CallOption) (*Operation, error) } // VpnTunnelsClient is a client for interacting with Google Compute Engine API. @@ -132,6 +135,11 @@ func (c *VpnTunnelsClient) List(ctx context.Context, req *computepb.ListVpnTunne return c.internalClient.List(ctx, req, opts...) } +// SetLabels sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. +func (c *VpnTunnelsClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnTunnelRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetLabels(ctx, req, opts...) +} + // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. type vpnTunnelsRESTClient struct { // The http endpoint to connect to. @@ -615,6 +623,81 @@ func (c *vpnTunnelsRESTClient) List(ctx context.Context, req *computepb.ListVpnT return it } +// SetLabels sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation. +func (c *vpnTunnelsRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsVpnTunnelRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetRegionSetLabelsRequestResource() + jsonReq, err := m.Marshal(body) + if err != nil { + return nil, err + } + + baseUrl, err := url.Parse(c.endpoint) + if err != nil { + return nil, err + } + baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/vpnTunnels/%v/setLabels", req.GetProject(), req.GetRegion(), req.GetResource()) + + params := url.Values{} + if req != nil && req.RequestId != nil { + params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) + } + + baseUrl.RawQuery = params.Encode() + + // Build HTTP headers from client and context metadata. + md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + opts = append((*c.CallOptions).SetLabels[0:len((*c.CallOptions).SetLabels):len((*c.CallOptions).SetLabels)], opts...) + unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true} + resp := &computepb.Operation{} + e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + if settings.Path != "" { + baseUrl.Path = settings.Path + } + httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq)) + if err != nil { + return err + } + httpReq = httpReq.WithContext(ctx) + httpReq.Header = headers + + httpRsp, err := c.httpClient.Do(httpReq) + if err != nil { + return err + } + defer httpRsp.Body.Close() + + if err = googleapi.CheckResponse(httpRsp); err != nil { + return err + } + + buf, err := ioutil.ReadAll(httpRsp.Body) + if err != nil { + return err + } + + if err := unm.Unmarshal(buf, resp); err != nil { + return maybeUnknownEnum(err) + } + + return nil + }, opts...) + if e != nil { + return nil, e + } + op := &Operation{ + ®ionOperationsHandle{ + c: c.operationClient, + proto: resp, + project: req.GetProject(), + region: req.GetRegion(), + }, + } + return op, nil +} + // VpnTunnelIterator manages a stream of *computepb.VpnTunnel. type VpnTunnelIterator struct { items []*computepb.VpnTunnel diff --git a/compute/apiv1/vpn_tunnels_client_example_test.go b/compute/apiv1/vpn_tunnels_client_example_test.go index 3b9d6bdcf66..70a667e0f9b 100644 --- a/compute/apiv1/vpn_tunnels_client_example_test.go +++ b/compute/apiv1/vpn_tunnels_client_example_test.go @@ -183,3 +183,31 @@ func ExampleVpnTunnelsClient_List() { _ = resp } } + +func ExampleVpnTunnelsClient_SetLabels() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsVpnTunnelRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsVpnTunnelRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} diff --git a/compute/go.mod b/compute/go.mod index 29976657674..65ec9ba600f 100644 --- a/compute/go.mod +++ b/compute/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.102.1 github.com/google/go-cmp v0.5.8 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220819153447-c7cd466b0e09 + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 ) @@ -17,9 +17,9 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/compute/go.sum b/compute/go.sum index 68bf4df4f7f..42ad952fdb8 100644 --- a/compute/go.sum +++ b/compute/go.sum @@ -30,6 +30,7 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -49,6 +50,7 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -290,8 +292,9 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -312,6 +315,7 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= @@ -385,8 +389,9 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -499,8 +504,9 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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= @@ -589,8 +595,9 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220819153447-c7cd466b0e09 h1:iw8luj804hqA2C43tq4SXb4OQNgaJU0KzSZHOHfdA4U= -google.golang.org/genproto v0.0.0-20220819153447-c7cd466b0e09/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de h1:5ANeKFmGdtiputJJYeUVg8nTGA/1bEirx4CgzcnPSx8= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= 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/go.mod b/go.mod index 221283a42e9..822845e5b80 100644 --- a/go.mod +++ b/go.mod @@ -12,8 +12,8 @@ require ( go.opencensus.io v0.23.0 golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 ) @@ -24,8 +24,8 @@ require ( github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect github.com/googleapis/go-type-adapters v1.0.0 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/go.sum b/go.sum index 8eb19ec5c38..cbd954ce354 100644 --- a/go.sum +++ b/go.sum @@ -301,8 +301,9 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -398,8 +399,9 @@ golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -515,8 +517,8 @@ google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3 google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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= @@ -606,8 +608,8 @@ google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f h1:wwbo0UziciPT4Dsca+bmplW53QNAl7tiUOw7FfAcsf8= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 h1:lkYqfLZL9+9C+SltHOTeOHL6uueWYYkGp5NoeOZQsis= +google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= 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/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json b/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json index b2e068081ff..c54e23ef4dc 100644 --- a/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json +++ b/internal/generated/snippets/bigquery/connection/apiv1/snippet_metadata.google.cloud.bigquery.connection.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/connection/apiv1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json index 8fd2a256b72..d9a99a28063 100644 --- a/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json +++ b/internal/generated/snippets/bigquery/connection/apiv1beta1/snippet_metadata.google.cloud.bigquery.connection.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/connection/apiv1beta1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json b/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json index c7818e79016..edc33dcd0e9 100644 --- a/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json +++ b/internal/generated/snippets/bigquery/dataexchange/apiv1beta1/snippet_metadata.google.cloud.bigquery.dataexchange.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/dataexchange/apiv1beta1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json b/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json index 1daca46fff6..8cadc912bd9 100644 --- a/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json +++ b/internal/generated/snippets/bigquery/datatransfer/apiv1/snippet_metadata.google.cloud.bigquery.datatransfer.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/datatransfer/apiv1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json b/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json index 358f39675f6..dec763e8b92 100644 --- a/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json +++ b/internal/generated/snippets/bigquery/migration/apiv2/snippet_metadata.google.cloud.bigquery.migration.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/migration/apiv2", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json b/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json index 831b75ee835..77af936f1e8 100644 --- a/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json +++ b/internal/generated/snippets/bigquery/migration/apiv2alpha/snippet_metadata.google.cloud.bigquery.migration.v2alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/migration/apiv2alpha", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index 4016fd046f8..0aabad5642b 100644 --- a/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/internal/generated/snippets/bigquery/reservation/apiv1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/reservation/apiv1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json b/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json index a6946aa0617..a0fe07b6d13 100644 --- a/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json +++ b/internal/generated/snippets/bigquery/reservation/apiv1beta1/snippet_metadata.google.cloud.bigquery.reservation.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/reservation/apiv1beta1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json b/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json index e972d9d3734..d19925664ba 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json +++ b/internal/generated/snippets/bigquery/storage/apiv1/snippet_metadata.google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json b/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json index de90b65741b..64fcc464192 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json +++ b/internal/generated/snippets/bigquery/storage/apiv1beta1/snippet_metadata.google.cloud.bigquery.storage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1beta1", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json b/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json index c01fbdf3377..d1040274752 100644 --- a/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json +++ b/internal/generated/snippets/bigquery/storage/apiv1beta2/snippet_metadata.google.cloud.bigquery.storage.v1beta2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "cloud.google.com/go/bigquery/storage/apiv1beta2", - "version": "1.40.0", + "version": "1.41.0", "language": "GO", "apis": [ { diff --git a/internal/generated/snippets/compute/apiv1/AddressesClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/AddressesClient/SetLabels/main.go new file mode 100644 index 00000000000..4db6e8f3cdc --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/AddressesClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_Addresses_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsAddressRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsAddressRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_Addresses_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/BackendServicesClient/GetIamPolicy/main.go b/internal/generated/snippets/compute/apiv1/BackendServicesClient/GetIamPolicy/main.go new file mode 100644 index 00000000000..93f52c48102 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/BackendServicesClient/GetIamPolicy/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_BackendServices_GetIamPolicy_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetIamPolicyBackendServiceRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_BackendServices_GetIamPolicy_sync] diff --git a/internal/generated/snippets/compute/apiv1/BackendServicesClient/SetIamPolicy/main.go b/internal/generated/snippets/compute/apiv1/BackendServicesClient/SetIamPolicy/main.go new file mode 100644 index 00000000000..dc55e7a10cd --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/BackendServicesClient/SetIamPolicy/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_BackendServices_SetIamPolicy_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetIamPolicyBackendServiceRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_BackendServices_SetIamPolicy_sync] diff --git a/internal/generated/snippets/compute/apiv1/GlobalAddressesClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/GlobalAddressesClient/SetLabels/main.go new file mode 100644 index 00000000000..e8d6905a226 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/GlobalAddressesClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_GlobalAddresses_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewGlobalAddressesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsGlobalAddressRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsGlobalAddressRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_GlobalAddresses_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/InterconnectAttachmentsClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/InterconnectAttachmentsClient/SetLabels/main.go new file mode 100644 index 00000000000..cd9d5180c9c --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/InterconnectAttachmentsClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_InterconnectAttachments_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewInterconnectAttachmentsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsInterconnectAttachmentRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsInterconnectAttachmentRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_InterconnectAttachments_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/InterconnectsClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/InterconnectsClient/SetLabels/main.go new file mode 100644 index 00000000000..f97e6df3c1c --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/InterconnectsClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_Interconnects_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewInterconnectsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsInterconnectRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsInterconnectRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_Interconnects_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/GetIamPolicy/main.go b/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/GetIamPolicy/main.go new file mode 100644 index 00000000000..a72cc22241d --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/GetIamPolicy/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionBackendServices_GetIamPolicy_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetIamPolicyRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetIamPolicyRegionBackendServiceRequest. + } + resp, err := c.GetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_RegionBackendServices_GetIamPolicy_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/SetIamPolicy/main.go b/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/SetIamPolicy/main.go new file mode 100644 index 00000000000..3cba99b5472 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionBackendServicesClient/SetIamPolicy/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionBackendServices_SetIamPolicy_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionBackendServicesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetIamPolicyRegionBackendServiceRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetIamPolicyRegionBackendServiceRequest. + } + resp, err := c.SetIamPolicy(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_RegionBackendServices_SetIamPolicy_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Delete/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Delete/main.go new file mode 100644 index 00000000000..5a85fac5d1b --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Delete/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_Delete_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteRegionSslPolicyRequest. + } + op, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_RegionSslPolicies_Delete_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Get/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Get/main.go new file mode 100644 index 00000000000..74575c7e23a --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Get/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_Get_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetRegionSslPolicyRequest. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_RegionSslPolicies_Get_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Insert/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Insert/main.go new file mode 100644 index 00000000000..f164c279529 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Insert/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_Insert_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertRegionSslPolicyRequest. + } + op, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_RegionSslPolicies_Insert_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/List/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/List/main.go new file mode 100644 index 00000000000..cc0abf9226a --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/List/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_List_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + "google.golang.org/api/iterator" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListRegionSslPoliciesRequest. + } + it := c.List(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END compute_v1_generated_RegionSslPolicies_List_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/ListAvailableFeatures/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/ListAvailableFeatures/main.go new file mode 100644 index 00000000000..c7ace5626d6 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/ListAvailableFeatures/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListAvailableFeaturesRegionSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListAvailableFeaturesRegionSslPoliciesRequest. + } + resp, err := c.ListAvailableFeatures(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Patch/main.go b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Patch/main.go new file mode 100644 index 00000000000..3645c1879da --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionSslPoliciesClient/Patch/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionSslPolicies_Patch_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.PatchRegionSslPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#PatchRegionSslPolicyRequest. + } + op, err := c.Patch(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_RegionSslPolicies_Patch_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Delete/main.go b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Delete/main.go new file mode 100644 index 00000000000..68632e107e9 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Delete/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionTargetTcpProxies_Delete_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.DeleteRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#DeleteRegionTargetTcpProxyRequest. + } + op, err := c.Delete(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_RegionTargetTcpProxies_Delete_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Get/main.go b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Get/main.go new file mode 100644 index 00000000000..9e8e35d8228 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Get/main.go @@ -0,0 +1,53 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionTargetTcpProxies_Get_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.GetRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#GetRegionTargetTcpProxyRequest. + } + resp, err := c.Get(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} + +// [END compute_v1_generated_RegionTargetTcpProxies_Get_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Insert/main.go b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Insert/main.go new file mode 100644 index 00000000000..a539ca6cd91 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/Insert/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionTargetTcpProxies_Insert_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.InsertRegionTargetTcpProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#InsertRegionTargetTcpProxyRequest. + } + op, err := c.Insert(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_RegionTargetTcpProxies_Insert_sync] diff --git a/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/List/main.go b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/List/main.go new file mode 100644 index 00000000000..88f55efbca5 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/RegionTargetTcpProxiesClient/List/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_RegionTargetTcpProxies_List_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + "google.golang.org/api/iterator" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewRegionTargetTcpProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.ListRegionTargetTcpProxiesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#ListRegionTargetTcpProxiesRequest. + } + it := c.List(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END compute_v1_generated_RegionTargetTcpProxies_List_sync] diff --git a/internal/generated/snippets/compute/apiv1/SecurityPoliciesClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/SecurityPoliciesClient/SetLabels/main.go new file mode 100644 index 00000000000..dcf51161004 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/SecurityPoliciesClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_SecurityPolicies_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewSecurityPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsSecurityPolicyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsSecurityPolicyRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_SecurityPolicies_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/SslPoliciesClient/AggregatedList/main.go b/internal/generated/snippets/compute/apiv1/SslPoliciesClient/AggregatedList/main.go new file mode 100644 index 00000000000..7f759f1a35f --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/SslPoliciesClient/AggregatedList/main.go @@ -0,0 +1,60 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_SslPolicies_AggregatedList_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + "google.golang.org/api/iterator" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewSslPoliciesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.AggregatedListSslPoliciesRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#AggregatedListSslPoliciesRequest. + } + it := c.AggregatedList(ctx, req) + for { + resp, err := it.Next() + if err == iterator.Done { + break + } + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp + } +} + +// [END compute_v1_generated_SslPolicies_AggregatedList_sync] diff --git a/internal/generated/snippets/compute/apiv1/TargetVpnGatewaysClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/TargetVpnGatewaysClient/SetLabels/main.go new file mode 100644 index 00000000000..6fcc038476f --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/TargetVpnGatewaysClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_TargetVpnGateways_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewTargetVpnGatewaysRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsTargetVpnGatewayRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsTargetVpnGatewayRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_TargetVpnGateways_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/VpnTunnelsClient/SetLabels/main.go b/internal/generated/snippets/compute/apiv1/VpnTunnelsClient/SetLabels/main.go new file mode 100644 index 00000000000..ff2f2b8c01e --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/VpnTunnelsClient/SetLabels/main.go @@ -0,0 +1,56 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by cloud.google.com/go/internal/gapicgen/gensnippets. DO NOT EDIT. + +// [START compute_v1_generated_VpnTunnels_SetLabels_sync] + +package main + +import ( + "context" + + compute "cloud.google.com/go/compute/apiv1" + computepb "google.golang.org/genproto/googleapis/cloud/compute/v1" +) + +func main() { + ctx := context.Background() + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in: + // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options + c, err := compute.NewVpnTunnelsRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetLabelsVpnTunnelRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetLabelsVpnTunnelRequest. + } + op, err := c.SetLabels(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_VpnTunnels_SetLabels_sync] diff --git a/internal/generated/snippets/compute/apiv1/snippet_metadata.google.cloud.compute.v1.json b/internal/generated/snippets/compute/apiv1/snippet_metadata.google.cloud.compute.v1.json index 06a70e28cbc..0c57988b650 100644 --- a/internal/generated/snippets/compute/apiv1/snippet_metadata.google.cloud.compute.v1.json +++ b/internal/generated/snippets/compute/apiv1/snippet_metadata.google.cloud.compute.v1.json @@ -379,6 +379,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_Addresses_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.", + "file": "AddressesClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.AddressesClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsAddressRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "AddressesClient", + "fullName": "google.cloud.compute.v1.AddressesClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.Addresses.SetLabels", + "service": { + "shortName": "Addresses", + "fullName": "google.cloud.compute.v1.Addresses" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_Autoscalers_AggregatedList_sync", "title": "compute AggregatedList Sample", @@ -1391,6 +1437,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_BackendServices_GetIamPolicy_sync", + "title": "compute GetIamPolicy Sample", + "description": "GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "file": "BackendServicesClient/GetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.compute.v1.BackendServicesClient.GetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.GetIamPolicyBackendServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "computepb.Policy", + "client": { + "shortName": "BackendServicesClient", + "fullName": "google.cloud.compute.v1.BackendServicesClient" + }, + "method": { + "shortName": "GetIamPolicy", + "fullName": "google.cloud.compute.v1.BackendServices.GetIamPolicy", + "service": { + "shortName": "BackendServices", + "fullName": "google.cloud.compute.v1.BackendServices" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_BackendServices_Insert_sync", "title": "compute Insert Sample", @@ -1575,6 +1667,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_BackendServices_SetIamPolicy_sync", + "title": "compute SetIamPolicy Sample", + "description": "SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.", + "file": "BackendServicesClient/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.compute.v1.BackendServicesClient.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetIamPolicyBackendServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "computepb.Policy", + "client": { + "shortName": "BackendServicesClient", + "fullName": "google.cloud.compute.v1.BackendServicesClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.compute.v1.BackendServices.SetIamPolicy", + "service": { + "shortName": "BackendServices", + "fullName": "google.cloud.compute.v1.BackendServices" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_BackendServices_SetSecurityPolicy_sync", "title": "compute SetSecurityPolicy Sample", @@ -4335,6 +4473,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_GlobalAddresses_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.", + "file": "GlobalAddressesClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.GlobalAddressesClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsGlobalAddressRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "GlobalAddressesClient", + "fullName": "google.cloud.compute.v1.GlobalAddressesClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.GlobalAddresses.SetLabels", + "service": { + "shortName": "GlobalAddresses", + "fullName": "google.cloud.compute.v1.GlobalAddresses" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_GlobalForwardingRules_Delete_sync", "title": "compute Delete Sample", @@ -10453,6 +10637,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_InterconnectAttachments_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on an InterconnectAttachment. To learn more about labels, read the Labeling Resources documentation.", + "file": "InterconnectAttachmentsClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentsClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsInterconnectAttachmentRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "InterconnectAttachmentsClient", + "fullName": "google.cloud.compute.v1.InterconnectAttachmentsClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectAttachments.SetLabels", + "service": { + "shortName": "InterconnectAttachments", + "fullName": "google.cloud.compute.v1.InterconnectAttachments" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_InterconnectLocations_Get_sync", "title": "compute Get Sample", @@ -10821,6 +11051,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_Interconnects_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on an Interconnect. To learn more about labels, read the Labeling Resources documentation.", + "file": "InterconnectsClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.InterconnectsClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsInterconnectRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "InterconnectsClient", + "fullName": "google.cloud.compute.v1.InterconnectsClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.Interconnects.SetLabels", + "service": { + "shortName": "Interconnects", + "fullName": "google.cloud.compute.v1.Interconnects" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_LicenseCodes_Get_sync", "title": "compute Get Sample", @@ -16526,21 +16802,21 @@ ] }, { - "regionTag": "compute_v1_generated_RegionBackendServices_Insert_sync", - "title": "compute Insert Sample", - "description": "Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.", - "file": "RegionBackendServicesClient/Insert/main.go", + "regionTag": "compute_v1_generated_RegionBackendServices_GetIamPolicy_sync", + "title": "compute GetIamPolicy Sample", + "description": "GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.", + "file": "RegionBackendServicesClient/GetIamPolicy/main.go", "language": "GO", "clientMethod": { - "shortName": "Insert", - "fullName": "google.cloud.compute.v1.RegionBackendServicesClient.Insert", + "shortName": "GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServicesClient.GetIamPolicy", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.InsertRegionBackendServiceRequest", + "type": "computepb.GetIamPolicyRegionBackendServiceRequest", "name": "req" }, { @@ -16548,14 +16824,60 @@ "name": "opts" } ], - "resultType": "Operation", + "resultType": "computepb.Policy", "client": { "shortName": "RegionBackendServicesClient", "fullName": "google.cloud.compute.v1.RegionBackendServicesClient" }, "method": { - "shortName": "Insert", - "fullName": "google.cloud.compute.v1.RegionBackendServices.Insert", + "shortName": "GetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServices.GetIamPolicy", + "service": { + "shortName": "RegionBackendServices", + "fullName": "google.cloud.compute.v1.RegionBackendServices" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionBackendServices_Insert_sync", + "title": "compute Insert Sample", + "description": "Insert creates a regional BackendService resource in the specified project using the data included in the request. For more information, see Backend services overview.", + "file": "RegionBackendServicesClient/Insert/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionBackendServicesClient.Insert", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.InsertRegionBackendServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionBackendServicesClient", + "fullName": "google.cloud.compute.v1.RegionBackendServicesClient" + }, + "method": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionBackendServices.Insert", "service": { "shortName": "RegionBackendServices", "fullName": "google.cloud.compute.v1.RegionBackendServices" @@ -16663,6 +16985,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_RegionBackendServices_SetIamPolicy_sync", + "title": "compute SetIamPolicy Sample", + "description": "SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.", + "file": "RegionBackendServicesClient/SetIamPolicy/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServicesClient.SetIamPolicy", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetIamPolicyRegionBackendServiceRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "computepb.Policy", + "client": { + "shortName": "RegionBackendServicesClient", + "fullName": "google.cloud.compute.v1.RegionBackendServicesClient" + }, + "method": { + "shortName": "SetIamPolicy", + "fullName": "google.cloud.compute.v1.RegionBackendServices.SetIamPolicy", + "service": { + "shortName": "RegionBackendServices", + "fullName": "google.cloud.compute.v1.RegionBackendServices" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_RegionBackendServices_Update_sync", "title": "compute Update Sample", @@ -20941,6 +21309,282 @@ } ] }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_Delete_sync", + "title": "compute Delete Sample", + "description": "Delete deletes the specified SSL policy. The SSL policy resource can be deleted only if it is not in use by any TargetHttpsProxy or TargetSslProxy resources.", + "file": "RegionSslPoliciesClient/Delete/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Delete", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.Delete", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.DeleteRegionSslPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "Delete", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Delete", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_Get_sync", + "title": "compute Get Sample", + "description": "Get lists all of the ordered rules present in a single specified policy.", + "file": "RegionSslPoliciesClient/Get/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Get", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.Get", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.GetRegionSslPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "computepb.SslPolicy", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "Get", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Get", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_Insert_sync", + "title": "compute Insert Sample", + "description": "Insert creates a new policy in the specified project and region using the data included in the request.", + "file": "RegionSslPoliciesClient/Insert/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.Insert", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.InsertRegionSslPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Insert", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_List_sync", + "title": "compute List Sample", + "description": "List lists all the SSL policies that have been configured for the specified project and region.", + "file": "RegionSslPoliciesClient/List/main.go", + "language": "GO", + "clientMethod": { + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.List", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.ListRegionSslPoliciesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "SslPolicyIterator", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.List", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 59, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_ListAvailableFeatures_sync", + "title": "compute ListAvailableFeatures Sample", + "description": "ListAvailableFeatures lists all features that can be specified in the SSL policy when using custom profile.", + "file": "RegionSslPoliciesClient/ListAvailableFeatures/main.go", + "language": "GO", + "clientMethod": { + "shortName": "ListAvailableFeatures", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.ListAvailableFeatures", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.ListAvailableFeaturesRegionSslPoliciesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "computepb.SslPoliciesListAvailableFeaturesResponse", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "ListAvailableFeatures", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.ListAvailableFeatures", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionSslPolicies_Patch_sync", + "title": "compute Patch Sample", + "description": "Patch patches the specified SSL policy with the data included in the request.", + "file": "RegionSslPoliciesClient/Patch/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Patch", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient.Patch", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.PatchRegionSslPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionSslPoliciesClient", + "fullName": "google.cloud.compute.v1.RegionSslPoliciesClient" + }, + "method": { + "shortName": "Patch", + "fullName": "google.cloud.compute.v1.RegionSslPolicies.Patch", + "service": { + "shortName": "RegionSslPolicies", + "fullName": "google.cloud.compute.v1.RegionSslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_RegionTargetHttpProxies_Delete_sync", "title": "compute Delete Sample", @@ -21258,27 +21902,211 @@ "segments": [ { "start": 18, - "end": 52, + "end": 52, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Insert_sync", + "title": "compute Insert Sample", + "description": "Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.", + "file": "RegionTargetHttpsProxiesClient/Insert/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.Insert", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.InsertRegionTargetHttpsProxyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionTargetHttpsProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + }, + "method": { + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Insert", + "service": { + "shortName": "RegionTargetHttpsProxies", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_List_sync", + "title": "compute List Sample", + "description": "List retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.", + "file": "RegionTargetHttpsProxiesClient/List/main.go", + "language": "GO", + "clientMethod": { + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.List", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.ListRegionTargetHttpsProxiesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "TargetHttpsProxyIterator", + "client": { + "shortName": "RegionTargetHttpsProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + }, + "method": { + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.List", + "service": { + "shortName": "RegionTargetHttpsProxies", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 59, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Patch_sync", + "title": "compute Patch Sample", + "description": "Patch patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.", + "file": "RegionTargetHttpsProxiesClient/Patch/main.go", + "language": "GO", + "clientMethod": { + "shortName": "Patch", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.Patch", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.PatchRegionTargetHttpsProxyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionTargetHttpsProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + }, + "method": { + "shortName": "Patch", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Patch", + "service": { + "shortName": "RegionTargetHttpsProxies", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, + { + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync", + "title": "compute SetSslCertificates Sample", + "description": "SetSslCertificates replaces SslCertificates for TargetHttpsProxy.", + "file": "RegionTargetHttpsProxiesClient/SetSslCertificates/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetSslCertificates", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.SetSslCertificates", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetSslCertificatesRegionTargetHttpsProxyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "RegionTargetHttpsProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + }, + "method": { + "shortName": "SetSslCertificates", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificates", + "service": { + "shortName": "RegionTargetHttpsProxies", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, "type": "FULL" } ] }, { - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Insert_sync", - "title": "compute Insert Sample", - "description": "Insert creates a TargetHttpsProxy resource in the specified project and region using the data included in the request.", - "file": "RegionTargetHttpsProxiesClient/Insert/main.go", + "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync", + "title": "compute SetUrlMap Sample", + "description": "SetUrlMap changes the URL map for TargetHttpsProxy.", + "file": "RegionTargetHttpsProxiesClient/SetUrlMap/main.go", "language": "GO", "clientMethod": { - "shortName": "Insert", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.Insert", + "shortName": "SetUrlMap", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.SetUrlMap", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.InsertRegionTargetHttpsProxyRequest", + "type": "computepb.SetUrlMapRegionTargetHttpsProxyRequest", "name": "req" }, { @@ -21292,8 +22120,8 @@ "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" }, "method": { - "shortName": "Insert", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Insert", + "shortName": "SetUrlMap", + "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMap", "service": { "shortName": "RegionTargetHttpsProxies", "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" @@ -21310,21 +22138,21 @@ ] }, { - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_List_sync", - "title": "compute List Sample", - "description": "List retrieves the list of TargetHttpsProxy resources available to the specified project in the specified region.", - "file": "RegionTargetHttpsProxiesClient/List/main.go", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Delete_sync", + "title": "compute Delete Sample", + "description": "Delete deletes the specified TargetTcpProxy resource.", + "file": "RegionTargetTcpProxiesClient/Delete/main.go", "language": "GO", "clientMethod": { - "shortName": "List", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.List", + "shortName": "Delete", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient.Delete", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.ListRegionTargetHttpsProxiesRequest", + "type": "computepb.DeleteRegionTargetTcpProxyRequest", "name": "req" }, { @@ -21332,17 +22160,17 @@ "name": "opts" } ], - "resultType": "TargetHttpsProxyIterator", + "resultType": "Operation", "client": { - "shortName": "RegionTargetHttpsProxiesClient", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + "shortName": "RegionTargetTcpProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient" }, "method": { - "shortName": "List", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.List", + "shortName": "Delete", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Delete", "service": { - "shortName": "RegionTargetHttpsProxies", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + "shortName": "RegionTargetTcpProxies", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies" } } }, @@ -21350,27 +22178,27 @@ "segments": [ { "start": 18, - "end": 59, + "end": 55, "type": "FULL" } ] }, { - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_Patch_sync", - "title": "compute Patch Sample", - "description": "Patch patches the specified regional TargetHttpsProxy resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.", - "file": "RegionTargetHttpsProxiesClient/Patch/main.go", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Get_sync", + "title": "compute Get Sample", + "description": "Get returns the specified TargetTcpProxy resource.", + "file": "RegionTargetTcpProxiesClient/Get/main.go", "language": "GO", "clientMethod": { - "shortName": "Patch", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.Patch", + "shortName": "Get", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient.Get", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.PatchRegionTargetHttpsProxyRequest", + "type": "computepb.GetRegionTargetTcpProxyRequest", "name": "req" }, { @@ -21378,17 +22206,17 @@ "name": "opts" } ], - "resultType": "Operation", + "resultType": "computepb.TargetTcpProxy", "client": { - "shortName": "RegionTargetHttpsProxiesClient", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + "shortName": "RegionTargetTcpProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient" }, "method": { - "shortName": "Patch", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.Patch", + "shortName": "Get", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Get", "service": { - "shortName": "RegionTargetHttpsProxies", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + "shortName": "RegionTargetTcpProxies", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies" } } }, @@ -21396,27 +22224,27 @@ "segments": [ { "start": 18, - "end": 55, + "end": 52, "type": "FULL" } ] }, { - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetSslCertificates_sync", - "title": "compute SetSslCertificates Sample", - "description": "SetSslCertificates replaces SslCertificates for TargetHttpsProxy.", - "file": "RegionTargetHttpsProxiesClient/SetSslCertificates/main.go", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_Insert_sync", + "title": "compute Insert Sample", + "description": "Insert creates a TargetTcpProxy resource in the specified project and region using the data included in the request.", + "file": "RegionTargetTcpProxiesClient/Insert/main.go", "language": "GO", "clientMethod": { - "shortName": "SetSslCertificates", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.SetSslCertificates", + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient.Insert", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.SetSslCertificatesRegionTargetHttpsProxyRequest", + "type": "computepb.InsertRegionTargetTcpProxyRequest", "name": "req" }, { @@ -21426,15 +22254,15 @@ ], "resultType": "Operation", "client": { - "shortName": "RegionTargetHttpsProxiesClient", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + "shortName": "RegionTargetTcpProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient" }, "method": { - "shortName": "SetSslCertificates", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetSslCertificates", + "shortName": "Insert", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.Insert", "service": { - "shortName": "RegionTargetHttpsProxies", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + "shortName": "RegionTargetTcpProxies", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies" } } }, @@ -21448,21 +22276,21 @@ ] }, { - "regionTag": "compute_v1_generated_RegionTargetHttpsProxies_SetUrlMap_sync", - "title": "compute SetUrlMap Sample", - "description": "SetUrlMap changes the URL map for TargetHttpsProxy.", - "file": "RegionTargetHttpsProxiesClient/SetUrlMap/main.go", + "regionTag": "compute_v1_generated_RegionTargetTcpProxies_List_sync", + "title": "compute List Sample", + "description": "List retrieves a list of TargetTcpProxy resources available to the specified project in a given region.", + "file": "RegionTargetTcpProxiesClient/List/main.go", "language": "GO", "clientMethod": { - "shortName": "SetUrlMap", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient.SetUrlMap", + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient.List", "parameters": [ { "type": "context.Context", "name": "ctx" }, { - "type": "computepb.SetUrlMapRegionTargetHttpsProxyRequest", + "type": "computepb.ListRegionTargetTcpProxiesRequest", "name": "req" }, { @@ -21470,17 +22298,17 @@ "name": "opts" } ], - "resultType": "Operation", + "resultType": "TargetTcpProxyIterator", "client": { - "shortName": "RegionTargetHttpsProxiesClient", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxiesClient" + "shortName": "RegionTargetTcpProxiesClient", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxiesClient" }, "method": { - "shortName": "SetUrlMap", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies.SetUrlMap", + "shortName": "List", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies.List", "service": { - "shortName": "RegionTargetHttpsProxies", - "fullName": "google.cloud.compute.v1.RegionTargetHttpsProxies" + "shortName": "RegionTargetTcpProxies", + "fullName": "google.cloud.compute.v1.RegionTargetTcpProxies" } } }, @@ -21488,7 +22316,7 @@ "segments": [ { "start": 18, - "end": 55, + "end": 59, "type": "FULL" } ] @@ -23885,6 +24713,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_SecurityPolicies_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on a security policy. To learn more about labels, read the Labeling Resources documentation.", + "file": "SecurityPoliciesClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.SecurityPoliciesClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsSecurityPolicyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "SecurityPoliciesClient", + "fullName": "google.cloud.compute.v1.SecurityPoliciesClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.SecurityPolicies.SetLabels", + "service": { + "shortName": "SecurityPolicies", + "fullName": "google.cloud.compute.v1.SecurityPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_ServiceAttachments_AggregatedList_sync", "title": "compute AggregatedList Sample", @@ -24897,6 +25771,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_SslPolicies_AggregatedList_sync", + "title": "compute AggregatedList Sample", + "description": "AggregatedList retrieves the list of all SslPolicy resources, regional and global, available to the specified project.", + "file": "SslPoliciesClient/AggregatedList/main.go", + "language": "GO", + "clientMethod": { + "shortName": "AggregatedList", + "fullName": "google.cloud.compute.v1.SslPoliciesClient.AggregatedList", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.AggregatedListSslPoliciesRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "SslPoliciesScopedListPairIterator", + "client": { + "shortName": "SslPoliciesClient", + "fullName": "google.cloud.compute.v1.SslPoliciesClient" + }, + "method": { + "shortName": "AggregatedList", + "fullName": "google.cloud.compute.v1.SslPolicies.AggregatedList", + "service": { + "shortName": "SslPolicies", + "fullName": "google.cloud.compute.v1.SslPolicies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 59, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_SslPolicies_Delete_sync", "title": "compute Delete Sample", @@ -28439,6 +29359,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_TargetVpnGateways_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.", + "file": "TargetVpnGatewaysClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.TargetVpnGatewaysClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsTargetVpnGatewayRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "TargetVpnGatewaysClient", + "fullName": "google.cloud.compute.v1.TargetVpnGatewaysClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.TargetVpnGateways.SetLabels", + "service": { + "shortName": "TargetVpnGateways", + "fullName": "google.cloud.compute.v1.TargetVpnGateways" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_UrlMaps_AggregatedList_sync", "title": "compute AggregatedList Sample", @@ -29451,6 +30417,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_VpnTunnels_SetLabels_sync", + "title": "compute SetLabels Sample", + "description": "SetLabels sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.", + "file": "VpnTunnelsClient/SetLabels/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.VpnTunnelsClient.SetLabels", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetLabelsVpnTunnelRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "VpnTunnelsClient", + "fullName": "google.cloud.compute.v1.VpnTunnelsClient" + }, + "method": { + "shortName": "SetLabels", + "fullName": "google.cloud.compute.v1.VpnTunnels.SetLabels", + "service": { + "shortName": "VpnTunnels", + "fullName": "google.cloud.compute.v1.VpnTunnels" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 55, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_ZoneOperations_Delete_sync", "title": "compute Delete Sample", diff --git a/internal/generated/snippets/go.mod b/internal/generated/snippets/go.mod index af550bc8e2f..7310a744e1f 100644 --- a/internal/generated/snippets/go.mod +++ b/internal/generated/snippets/go.mod @@ -119,8 +119,8 @@ require ( cloud.google.com/go/websecurityscanner v1.2.0 cloud.google.com/go/workflows v1.5.0 github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de ) require ( @@ -134,7 +134,7 @@ require ( github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect github.com/googleapis/gax-go/v2 v2.5.1 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect golang.org/x/text v0.3.7 // indirect diff --git a/internal/generated/snippets/go.sum b/internal/generated/snippets/go.sum index c5f4d201811..7d358a63d35 100644 --- a/internal/generated/snippets/go.sum +++ b/internal/generated/snippets/go.sum @@ -118,8 +118,8 @@ golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220812174116-3211cb980234 h1:RDqmgfe7SvlMWoqC3xwQ2blLO3fcWcxMa3eBLRdRW7E= -golang.org/x/net v0.0.0-20220812174116-3211cb980234/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -193,8 +193,9 @@ google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs= google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -235,8 +236,9 @@ google.golang.org/genproto v0.0.0-20220908141613-51c1cc9bc6d0/go.mod h1:rQWNQYp1 google.golang.org/genproto v0.0.0-20220909194730-69f6226f97e5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= -google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 h1:lkYqfLZL9+9C+SltHOTeOHL6uueWYYkGp5NoeOZQsis= google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de h1:5ANeKFmGdtiputJJYeUVg8nTGA/1bEirx4CgzcnPSx8= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/internal/godocfx/go.mod b/internal/godocfx/go.mod index 2d4fbceaaa2..1a0057934e1 100644 --- a/internal/godocfx/go.mod +++ b/internal/godocfx/go.mod @@ -25,14 +25,14 @@ require ( github.com/googleapis/go-type-adapters v1.0.0 // indirect go.opencensus.io v0.23.0 // indirect golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect - google.golang.org/api v0.95.0 // indirect + google.golang.org/api v0.96.0 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f // indirect + google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 // indirect google.golang.org/grpc v1.48.0 // indirect google.golang.org/protobuf v1.28.1 // indirect ) diff --git a/internal/godocfx/go.sum b/internal/godocfx/go.sum index 0df1d9877b5..4d8ca07ece3 100644 --- a/internal/godocfx/go.sum +++ b/internal/godocfx/go.sum @@ -149,8 +149,9 @@ golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= @@ -199,8 +200,9 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -240,8 +242,8 @@ google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6r google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g= google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -278,8 +280,8 @@ google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220622131801-db39fadba55f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f h1:wwbo0UziciPT4Dsca+bmplW53QNAl7tiUOw7FfAcsf8= -google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= +google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85 h1:lkYqfLZL9+9C+SltHOTeOHL6uueWYYkGp5NoeOZQsis= +google.golang.org/genproto v0.0.0-20220914210030-581e60b4ef85/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= diff --git a/run/go.mod b/run/go.mod index c4c35fa061c..5e79e27b239 100644 --- a/run/go.mod +++ b/run/go.mod @@ -5,8 +5,8 @@ go 1.18 require ( cloud.google.com/go v0.102.1 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/run/go.sum b/run/go.sum index c796dcdc667..a221d9aed1d 100644 --- a/run/go.sum +++ b/run/go.sum @@ -291,8 +291,9 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -386,8 +387,8 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -500,8 +501,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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= @@ -590,8 +591,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959 h1:hw4Y42zL1VyVKxPgRHHh191fpVBGV8sNVmcow5Z8VXY= -google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de h1:5ANeKFmGdtiputJJYeUVg8nTGA/1bEirx4CgzcnPSx8= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= 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/securitycenter/go.mod b/securitycenter/go.mod index 372abb1a470..8a77e1be19c 100644 --- a/securitycenter/go.mod +++ b/securitycenter/go.mod @@ -6,8 +6,8 @@ require ( cloud.google.com/go v0.102.1 github.com/golang/protobuf v1.5.2 github.com/googleapis/gax-go/v2 v2.4.0 - google.golang.org/api v0.95.0 - google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf + google.golang.org/api v0.96.0 + google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de google.golang.org/grpc v1.48.0 google.golang.org/protobuf v1.28.1 ) @@ -18,9 +18,9 @@ require ( github.com/google/go-cmp v0.5.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect go.opencensus.io v0.23.0 // indirect - golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect + golang.org/x/net v0.0.0-20220909164309-bea034e7d591 // indirect golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 // indirect - golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect + golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect golang.org/x/text v0.3.7 // indirect google.golang.org/appengine v1.6.7 // indirect ) diff --git a/securitycenter/go.sum b/securitycenter/go.sum index 104b63a3b44..676579e3fa7 100644 --- a/securitycenter/go.sum +++ b/securitycenter/go.sum @@ -30,6 +30,7 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1 h1:vpK6iQWv/2uUeFJth4/cBHsQAGjn1iIE6AAlxipRaA0= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= +cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -50,6 +51,7 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= @@ -291,8 +293,9 @@ golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e h1:TsQ7F31D3bUCLeqPT0u+yjp1guoArKaNKmCr22PYgTQ= golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591 h1:D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI= +golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -313,6 +316,7 @@ golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= +golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE= golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1 h1:lxqLZaMad/dJHMFZH0NiNpiEZI/nhgWhe4wgzpE+MuA= golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= @@ -386,8 +390,9 @@ golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220624220833-87e55d714810 h1:rHZQSjJdAI4Xf5Qzeh2bBc5YJIkPFVM6oDtMFYmgws0= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 h1:WIoqL4EROvwiPdUtaip4VcDdpZ4kha7wBWZrbVKCIZg= +golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -500,8 +505,9 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.95.0 h1:d1c24AAS01DYqXreBeuVV7ewY/U8Mnhh47pwtsgVtYg= -google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI= +google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw= +google.golang.org/api v0.96.0 h1:F60cuQPJq7K7FzsxMYHAUJSiXh2oKctHxBMbDygxhfM= +google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= 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= @@ -590,8 +596,9 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf h1:Q5xNKbTSFwkuaaGaR7CMcXEM5sy19KYdUU8iF8/iRC0= -google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de h1:5ANeKFmGdtiputJJYeUVg8nTGA/1bEirx4CgzcnPSx8= +google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo= 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=