diff --git a/compute/apiv1/gapic_metadata.json b/compute/apiv1/gapic_metadata.json index 0cb48099150c..fac5f88daac9 100644 --- a/compute/apiv1/gapic_metadata.json +++ b/compute/apiv1/gapic_metadata.json @@ -3561,6 +3561,11 @@ "Patch" ] }, + "SetCertificateMap": { + "methods": [ + "SetCertificateMap" + ] + }, "SetQuicOverride": { "methods": [ "SetQuicOverride" @@ -3713,6 +3718,11 @@ "SetBackendService" ] }, + "SetCertificateMap": { + "methods": [ + "SetCertificateMap" + ] + }, "SetProxyHeader": { "methods": [ "SetProxyHeader" diff --git a/compute/apiv1/instance_group_managers_client.go b/compute/apiv1/instance_group_managers_client.go index 436562a03dc6..88253b8b76fe 100644 --- a/compute/apiv1/instance_group_managers_client.go +++ b/compute/apiv1/instance_group_managers_client.go @@ -141,7 +141,7 @@ func (c *InstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context.Contex return c.internalClient.ApplyUpdatesToInstances(ctx, req, opts...) } -// CreateInstances creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +// CreateInstances creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. func (c *InstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.CreateInstances(ctx, req, opts...) } @@ -156,7 +156,7 @@ func (c *InstanceGroupManagersClient) DeleteInstances(ctx context.Context, req * return c.internalClient.DeleteInstances(ctx, req, opts...) } -// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +// DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group. func (c *InstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.DeletePerInstanceConfigs(ctx, req, opts...) } @@ -186,7 +186,7 @@ func (c *InstanceGroupManagersClient) ListManagedInstances(ctx context.Context, return c.internalClient.ListManagedInstances(ctx, req, opts...) } -// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +// ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. func (c *InstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator { return c.internalClient.ListPerInstanceConfigs(ctx, req, opts...) } @@ -196,7 +196,7 @@ func (c *InstanceGroupManagersClient) Patch(ctx context.Context, req *computepb. return c.internalClient.Patch(ctx, req, opts...) } -// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *InstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.PatchPerInstanceConfigs(ctx, req, opts...) } @@ -221,7 +221,7 @@ func (c *InstanceGroupManagersClient) SetTargetPools(ctx context.Context, req *c return c.internalClient.SetTargetPools(ctx, req, opts...) } -// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *InstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.UpdatePerInstanceConfigs(ctx, req, opts...) } @@ -553,7 +553,7 @@ func (c *instanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx context.Co return op, nil } -// CreateInstances creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +// CreateInstances creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. func (c *instanceGroupManagersRESTClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetInstanceGroupManagersCreateInstancesRequestResource() @@ -768,7 +768,7 @@ func (c *instanceGroupManagersRESTClient) DeleteInstances(ctx context.Context, r return op, nil } -// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +// DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group. func (c *instanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetInstanceGroupManagersDeletePerInstanceConfigsReqResource() @@ -1249,7 +1249,7 @@ func (c *instanceGroupManagersRESTClient) ListManagedInstances(ctx context.Conte return it } -// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +// ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. func (c *instanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator { it := &PerInstanceConfigIterator{} req = proto.Clone(req).(*computepb.ListPerInstanceConfigsInstanceGroupManagersRequest) @@ -1419,7 +1419,7 @@ func (c *instanceGroupManagersRESTClient) Patch(ctx context.Context, req *comput return op, nil } -// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *instanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetInstanceGroupManagersPatchPerInstanceConfigsReqResource() @@ -1783,7 +1783,7 @@ func (c *instanceGroupManagersRESTClient) SetTargetPools(ctx context.Context, re return op, nil } -// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *instanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetInstanceGroupManagersUpdatePerInstanceConfigsReqResource() diff --git a/compute/apiv1/instance_groups_client.go b/compute/apiv1/instance_groups_client.go index add6dcd16476..105947eb1c0e 100644 --- a/compute/apiv1/instance_groups_client.go +++ b/compute/apiv1/instance_groups_client.go @@ -134,7 +134,7 @@ func (c *InstanceGroupsClient) List(ctx context.Context, req *computepb.ListInst return c.internalClient.List(ctx, req, opts...) } -// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. +// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators. func (c *InstanceGroupsClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, opts ...gax.CallOption) *InstanceWithNamedPortsIterator { return c.internalClient.ListInstances(ctx, req, opts...) } @@ -698,7 +698,7 @@ func (c *instanceGroupsRESTClient) List(ctx context.Context, req *computepb.List return it } -// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. +// ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators. func (c *instanceGroupsRESTClient) ListInstances(ctx context.Context, req *computepb.ListInstancesInstanceGroupsRequest, opts ...gax.CallOption) *InstanceWithNamedPortsIterator { it := &InstanceWithNamedPortsIterator{} req = proto.Clone(req).(*computepb.ListInstancesInstanceGroupsRequest) diff --git a/compute/apiv1/instances_client.go b/compute/apiv1/instances_client.go index 5025c33f2691..87d39b3141cc 100644 --- a/compute/apiv1/instances_client.go +++ b/compute/apiv1/instances_client.go @@ -326,7 +326,7 @@ func (c *InstancesClient) SetMinCpuPlatform(ctx context.Context, req *computepb. return c.internalClient.SetMinCpuPlatform(ctx, req, opts...) } -// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM availability policies. +// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. func (c *InstancesClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.SetScheduling(ctx, req, opts...) } @@ -2587,7 +2587,7 @@ func (c *instancesRESTClient) SetMinCpuPlatform(ctx context.Context, req *comput return op, nil } -// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM availability policies. +// SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy. func (c *instancesRESTClient) SetScheduling(ctx context.Context, req *computepb.SetSchedulingInstanceRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetSchedulingResource() diff --git a/compute/apiv1/region_instance_group_managers_client.go b/compute/apiv1/region_instance_group_managers_client.go index 9ef2e95b26ff..8f8592f3830a 100644 --- a/compute/apiv1/region_instance_group_managers_client.go +++ b/compute/apiv1/region_instance_group_managers_client.go @@ -133,7 +133,7 @@ func (c *RegionInstanceGroupManagersClient) ApplyUpdatesToInstances(ctx context. return c.internalClient.ApplyUpdatesToInstances(ctx, req, opts...) } -// CreateInstances creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +// CreateInstances creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. func (c *RegionInstanceGroupManagersClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.CreateInstances(ctx, req, opts...) } @@ -148,7 +148,7 @@ func (c *RegionInstanceGroupManagersClient) DeleteInstances(ctx context.Context, return c.internalClient.DeleteInstances(ctx, req, opts...) } -// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +// DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group. func (c *RegionInstanceGroupManagersClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.DeletePerInstanceConfigs(ctx, req, opts...) } @@ -178,7 +178,7 @@ func (c *RegionInstanceGroupManagersClient) ListManagedInstances(ctx context.Con return c.internalClient.ListManagedInstances(ctx, req, opts...) } -// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +// ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. func (c *RegionInstanceGroupManagersClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator { return c.internalClient.ListPerInstanceConfigs(ctx, req, opts...) } @@ -188,7 +188,7 @@ func (c *RegionInstanceGroupManagersClient) Patch(ctx context.Context, req *comp return c.internalClient.Patch(ctx, req, opts...) } -// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *RegionInstanceGroupManagersClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.PatchPerInstanceConfigs(ctx, req, opts...) } @@ -213,7 +213,7 @@ func (c *RegionInstanceGroupManagersClient) SetTargetPools(ctx context.Context, return c.internalClient.SetTargetPools(ctx, req, opts...) } -// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *RegionInstanceGroupManagersClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.UpdatePerInstanceConfigs(ctx, req, opts...) } @@ -439,7 +439,7 @@ func (c *regionInstanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx cont return op, nil } -// CreateInstances creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. +// CreateInstances creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method. func (c *regionInstanceGroupManagersRESTClient) CreateInstances(ctx context.Context, req *computepb.CreateInstancesRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetRegionInstanceGroupManagersCreateInstancesRequestResource() @@ -654,7 +654,7 @@ func (c *regionInstanceGroupManagersRESTClient) DeleteInstances(ctx context.Cont return op, nil } -// DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group. +// DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group. func (c *regionInstanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.Context, req *computepb.DeletePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetRegionInstanceGroupManagerDeleteInstanceConfigReqResource() @@ -1135,7 +1135,7 @@ func (c *regionInstanceGroupManagersRESTClient) ListManagedInstances(ctx context return it } -// ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported. +// ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported. func (c *regionInstanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx context.Context, req *computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest, opts ...gax.CallOption) *PerInstanceConfigIterator { it := &PerInstanceConfigIterator{} req = proto.Clone(req).(*computepb.ListPerInstanceConfigsRegionInstanceGroupManagersRequest) @@ -1305,7 +1305,7 @@ func (c *regionInstanceGroupManagersRESTClient) Patch(ctx context.Context, req * return op, nil } -// PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *regionInstanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Context, req *computepb.PatchPerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetRegionInstanceGroupManagerPatchInstanceConfigReqResource() @@ -1669,7 +1669,7 @@ func (c *regionInstanceGroupManagersRESTClient) SetTargetPools(ctx context.Conte return op, nil } -// UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. +// UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http://perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch. func (c *regionInstanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.Context, req *computepb.UpdatePerInstanceConfigsRegionInstanceGroupManagerRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} body := req.GetRegionInstanceGroupManagerUpdateInstanceConfigReqResource() diff --git a/compute/apiv1/security_policies_client.go b/compute/apiv1/security_policies_client.go index 36a1bee9e570..3d5e998952ce 100644 --- a/compute/apiv1/security_policies_client.go +++ b/compute/apiv1/security_policies_client.go @@ -258,6 +258,13 @@ func (c *securityPoliciesRESTClient) AddRule(ctx context.Context, req *computepb } baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/securityPolicies/%v/addRule", req.GetProject(), req.GetSecurityPolicy()) + params := url.Values{} + if req != nil && req.ValidateOnly != nil { + params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly())) + } + + 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()), "security_policy", url.QueryEscape(req.GetSecurityPolicy()))) @@ -611,6 +618,9 @@ func (c *securityPoliciesRESTClient) Insert(ctx context.Context, req *computepb. if req != nil && req.RequestId != nil { params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId())) } + if req != nil && req.ValidateOnly != nil { + params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly())) + } baseUrl.RawQuery = params.Encode() @@ -924,6 +934,9 @@ func (c *securityPoliciesRESTClient) PatchRule(ctx context.Context, req *compute if req != nil && req.Priority != nil { params.Add("priority", fmt.Sprintf("%v", req.GetPriority())) } + if req != nil && req.ValidateOnly != nil { + params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly())) + } baseUrl.RawQuery = params.Encode() diff --git a/compute/apiv1/target_https_proxies_client.go b/compute/apiv1/target_https_proxies_client.go index 625dcabb18bd..c94018616430 100644 --- a/compute/apiv1/target_https_proxies_client.go +++ b/compute/apiv1/target_https_proxies_client.go @@ -49,6 +49,7 @@ type TargetHttpsProxiesCallOptions struct { Insert []gax.CallOption List []gax.CallOption Patch []gax.CallOption + SetCertificateMap []gax.CallOption SetQuicOverride []gax.CallOption SetSslCertificates []gax.CallOption SetSslPolicy []gax.CallOption @@ -66,6 +67,7 @@ type internalTargetHttpsProxiesClient interface { Insert(context.Context, *computepb.InsertTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListTargetHttpsProxiesRequest, ...gax.CallOption) *TargetHttpsProxyIterator Patch(context.Context, *computepb.PatchTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) + SetCertificateMap(context.Context, *computepb.SetCertificateMapTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) SetQuicOverride(context.Context, *computepb.SetQuicOverrideTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) SetSslCertificates(context.Context, *computepb.SetSslCertificatesTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) SetSslPolicy(context.Context, *computepb.SetSslPolicyTargetHttpsProxyRequest, ...gax.CallOption) (*Operation, error) @@ -136,6 +138,11 @@ func (c *TargetHttpsProxiesClient) Patch(ctx context.Context, req *computepb.Pat return c.internalClient.Patch(ctx, req, opts...) } +// SetCertificateMap changes the Certificate Map for TargetHttpsProxy. +func (c *TargetHttpsProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetCertificateMap(ctx, req, opts...) +} + // SetQuicOverride sets the QUIC override policy for TargetHttpsProxy. func (c *TargetHttpsProxiesClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.SetQuicOverride(ctx, req, opts...) @@ -702,6 +709,79 @@ func (c *targetHttpsProxiesRESTClient) Patch(ctx context.Context, req *computepb return op, nil } +// SetCertificateMap changes the Certificate Map for TargetHttpsProxy. +func (c *targetHttpsProxiesRESTClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetTargetHttpsProxiesSetCertificateMapRequestResource() + 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/targetHttpsProxies/%v/setCertificateMap", req.GetProject(), req.GetTargetHttpsProxy()) + + 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()), "target_https_proxy", url.QueryEscape(req.GetTargetHttpsProxy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 +} + // SetQuicOverride sets the QUIC override policy for TargetHttpsProxy. func (c *targetHttpsProxiesRESTClient) SetQuicOverride(ctx context.Context, req *computepb.SetQuicOverrideTargetHttpsProxyRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} diff --git a/compute/apiv1/target_https_proxies_client_example_test.go b/compute/apiv1/target_https_proxies_client_example_test.go index 1a8b012453e9..308366b6f6f5 100644 --- a/compute/apiv1/target_https_proxies_client_example_test.go +++ b/compute/apiv1/target_https_proxies_client_example_test.go @@ -177,6 +177,29 @@ func ExampleTargetHttpsProxiesClient_Patch() { } } +func ExampleTargetHttpsProxiesClient_SetCertificateMap() { + ctx := context.Background() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetCertificateMapTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetCertificateMapTargetHttpsProxyRequest. + } + op, err := c.SetCertificateMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + func ExampleTargetHttpsProxiesClient_SetQuicOverride() { ctx := context.Background() c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) diff --git a/compute/apiv1/target_ssl_proxies_client.go b/compute/apiv1/target_ssl_proxies_client.go index 44d24b07a053..037c80a8f112 100644 --- a/compute/apiv1/target_ssl_proxies_client.go +++ b/compute/apiv1/target_ssl_proxies_client.go @@ -47,6 +47,7 @@ type TargetSslProxiesCallOptions struct { Insert []gax.CallOption List []gax.CallOption SetBackendService []gax.CallOption + SetCertificateMap []gax.CallOption SetProxyHeader []gax.CallOption SetSslCertificates []gax.CallOption SetSslPolicy []gax.CallOption @@ -62,6 +63,7 @@ type internalTargetSslProxiesClient interface { Insert(context.Context, *computepb.InsertTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) List(context.Context, *computepb.ListTargetSslProxiesRequest, ...gax.CallOption) *TargetSslProxyIterator SetBackendService(context.Context, *computepb.SetBackendServiceTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) + SetCertificateMap(context.Context, *computepb.SetCertificateMapTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) SetProxyHeader(context.Context, *computepb.SetProxyHeaderTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) SetSslCertificates(context.Context, *computepb.SetSslCertificatesTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) SetSslPolicy(context.Context, *computepb.SetSslPolicyTargetSslProxyRequest, ...gax.CallOption) (*Operation, error) @@ -126,6 +128,11 @@ func (c *TargetSslProxiesClient) SetBackendService(ctx context.Context, req *com return c.internalClient.SetBackendService(ctx, req, opts...) } +// SetCertificateMap changes the Certificate Map for TargetSslProxy. +func (c *TargetSslProxiesClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error) { + return c.internalClient.SetCertificateMap(ctx, req, opts...) +} + // SetProxyHeader changes the ProxyHeaderType for TargetSslProxy. func (c *TargetSslProxiesClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error) { return c.internalClient.SetProxyHeader(ctx, req, opts...) @@ -581,6 +588,79 @@ func (c *targetSslProxiesRESTClient) SetBackendService(ctx context.Context, req return op, nil } +// SetCertificateMap changes the Certificate Map for TargetSslProxy. +func (c *targetSslProxiesRESTClient) SetCertificateMap(ctx context.Context, req *computepb.SetCertificateMapTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error) { + m := protojson.MarshalOptions{AllowPartial: true} + body := req.GetTargetSslProxiesSetCertificateMapRequestResource() + 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/targetSslProxies/%v/setCertificateMap", req.GetProject(), req.GetTargetSslProxy()) + + 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()), "target_ssl_proxy", url.QueryEscape(req.GetTargetSslProxy()))) + + headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json")) + 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 +} + // SetProxyHeader changes the ProxyHeaderType for TargetSslProxy. func (c *targetSslProxiesRESTClient) SetProxyHeader(ctx context.Context, req *computepb.SetProxyHeaderTargetSslProxyRequest, opts ...gax.CallOption) (*Operation, error) { m := protojson.MarshalOptions{AllowPartial: true} diff --git a/compute/apiv1/target_ssl_proxies_client_example_test.go b/compute/apiv1/target_ssl_proxies_client_example_test.go index 44d9a31658c6..fde6bcad9b81 100644 --- a/compute/apiv1/target_ssl_proxies_client_example_test.go +++ b/compute/apiv1/target_ssl_proxies_client_example_test.go @@ -151,6 +151,29 @@ func ExampleTargetSslProxiesClient_SetBackendService() { } } +func ExampleTargetSslProxiesClient_SetCertificateMap() { + ctx := context.Background() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetCertificateMapTargetSslProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetCertificateMapTargetSslProxyRequest. + } + op, err := c.SetCertificateMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + func ExampleTargetSslProxiesClient_SetProxyHeader() { ctx := context.Background() c, err := compute.NewTargetSslProxiesRESTClient(ctx) diff --git a/internal/generated/snippets/compute/apiv1/TargetHttpsProxiesClient/SetCertificateMap/main.go b/internal/generated/snippets/compute/apiv1/TargetHttpsProxiesClient/SetCertificateMap/main.go new file mode 100644 index 000000000000..376f7872fa43 --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/TargetHttpsProxiesClient/SetCertificateMap/main.go @@ -0,0 +1,51 @@ +// 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_TargetHttpsProxies_SetCertificateMap_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() + c, err := compute.NewTargetHttpsProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetCertificateMapTargetHttpsProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetCertificateMapTargetHttpsProxyRequest. + } + op, err := c.SetCertificateMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_TargetHttpsProxies_SetCertificateMap_sync] diff --git a/internal/generated/snippets/compute/apiv1/TargetSslProxiesClient/SetCertificateMap/main.go b/internal/generated/snippets/compute/apiv1/TargetSslProxiesClient/SetCertificateMap/main.go new file mode 100644 index 000000000000..d41b47025dce --- /dev/null +++ b/internal/generated/snippets/compute/apiv1/TargetSslProxiesClient/SetCertificateMap/main.go @@ -0,0 +1,51 @@ +// 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_TargetSslProxies_SetCertificateMap_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() + c, err := compute.NewTargetSslProxiesRESTClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &computepb.SetCertificateMapTargetSslProxyRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/compute/v1#SetCertificateMapTargetSslProxyRequest. + } + op, err := c.SetCertificateMap(ctx, req) + if err != nil { + // TODO: Handle error. + } + + err = op.Wait(ctx) + if err != nil { + // TODO: Handle error. + } +} + +// [END compute_v1_generated_TargetSslProxies_SetCertificateMap_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 24529ad7b478..2ce8236b50e6 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 @@ -6592,7 +6592,7 @@ { "regionTag": "compute_v1_generated_InstanceGroupManagers_CreateInstances_sync", "title": "compute CreateInstances Sample", - "description": "CreateInstances creates instances with per-instance configs in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.", + "description": "CreateInstances creates instances with per-instance configurations in this managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.", "file": "InstanceGroupManagersClient/CreateInstances/main.go", "language": "GO", "clientMethod": { @@ -6730,7 +6730,7 @@ { "regionTag": "compute_v1_generated_InstanceGroupManagers_DeletePerInstanceConfigs_sync", "title": "compute DeletePerInstanceConfigs Sample", - "description": "DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group.", + "description": "DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group.", "file": "InstanceGroupManagersClient/DeletePerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -7006,7 +7006,7 @@ { "regionTag": "compute_v1_generated_InstanceGroupManagers_ListPerInstanceConfigs_sync", "title": "compute ListPerInstanceConfigs Sample", - "description": "ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported.", + "description": "ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.", "file": "InstanceGroupManagersClient/ListPerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -7098,7 +7098,7 @@ { "regionTag": "compute_v1_generated_InstanceGroupManagers_PatchPerInstanceConfigs_sync", "title": "compute PatchPerInstanceConfigs Sample", - "description": "PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", + "description": "PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", "file": "InstanceGroupManagersClient/PatchPerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -7328,7 +7328,7 @@ { "regionTag": "compute_v1_generated_InstanceGroupManagers_UpdatePerInstanceConfigs_sync", "title": "compute UpdatePerInstanceConfigs Sample", - "description": "UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", + "description": "UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", "file": "InstanceGroupManagersClient/UpdatePerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -7650,7 +7650,7 @@ { "regionTag": "compute_v1_generated_InstanceGroups_ListInstances_sync", "title": "compute ListInstances Sample", - "description": "ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported.", + "description": "ListInstances lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators.", "file": "InstanceGroupsClient/ListInstances/main.go", "language": "GO", "clientMethod": { @@ -9490,7 +9490,7 @@ { "regionTag": "compute_v1_generated_Instances_SetScheduling_sync", "title": "compute SetScheduling Sample", - "description": "SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM availability policies.", + "description": "SetScheduling sets an instance’s scheduling options. You can only call this method on a stopped instance, that is, a VM instance that is in a TERMINATED state. See Instance Life Cycle for more information on the possible instance states. For more information about setting scheduling options for a VM, see Set VM host maintenance policy.", "file": "InstancesClient/SetScheduling/main.go", "language": "GO", "clientMethod": { @@ -18184,7 +18184,7 @@ { "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_CreateInstances_sync", "title": "compute CreateInstances Sample", - "description": "CreateInstances creates instances with per-instance configs in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.", + "description": "CreateInstances creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.", "file": "RegionInstanceGroupManagersClient/CreateInstances/main.go", "language": "GO", "clientMethod": { @@ -18322,7 +18322,7 @@ { "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_DeletePerInstanceConfigs_sync", "title": "compute DeletePerInstanceConfigs Sample", - "description": "DeletePerInstanceConfigs deletes selected per-instance configs for the managed instance group.", + "description": "DeletePerInstanceConfigs deletes selected per-instance configurations for the managed instance group.", "file": "RegionInstanceGroupManagersClient/DeletePerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -18598,7 +18598,7 @@ { "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_ListPerInstanceConfigs_sync", "title": "compute ListPerInstanceConfigs Sample", - "description": "ListPerInstanceConfigs lists all of the per-instance configs defined for the managed instance group. The orderBy query parameter is not supported.", + "description": "ListPerInstanceConfigs lists all of the per-instance configurations defined for the managed instance group. The orderBy query parameter is not supported.", "file": "RegionInstanceGroupManagersClient/ListPerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -18690,7 +18690,7 @@ { "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_PatchPerInstanceConfigs_sync", "title": "compute PatchPerInstanceConfigs Sample", - "description": "PatchPerInstanceConfigs inserts or patches per-instance configs for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", + "description": "PatchPerInstanceConfigs inserts or patches per-instance configurations for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", "file": "RegionInstanceGroupManagersClient/PatchPerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -18920,7 +18920,7 @@ { "regionTag": "compute_v1_generated_RegionInstanceGroupManagers_UpdatePerInstanceConfigs_sync", "title": "compute UpdatePerInstanceConfigs Sample", - "description": "UpdatePerInstanceConfigs inserts or updates per-instance configs for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", + "description": "UpdatePerInstanceConfigs inserts or updates per-instance configurations for the managed instance group. perInstanceConfig.name (at http: //perInstanceConfig.name) serves as a key used to distinguish whether to perform insert or patch.", "file": "RegionInstanceGroupManagersClient/UpdatePerInstanceConfigs/main.go", "language": "GO", "clientMethod": { @@ -26553,6 +26553,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_TargetHttpsProxies_SetCertificateMap_sync", + "title": "compute SetCertificateMap Sample", + "description": "SetCertificateMap changes the Certificate Map for TargetHttpsProxy.", + "file": "TargetHttpsProxiesClient/SetCertificateMap/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetCertificateMap", + "fullName": "google.cloud.compute.v1.TargetHttpsProxiesClient.SetCertificateMap", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetCertificateMapTargetHttpsProxyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "TargetHttpsProxiesClient", + "fullName": "google.cloud.compute.v1.TargetHttpsProxiesClient" + }, + "method": { + "shortName": "SetCertificateMap", + "fullName": "google.cloud.compute.v1.TargetHttpsProxies.SetCertificateMap", + "service": { + "shortName": "TargetHttpsProxies", + "fullName": "google.cloud.compute.v1.TargetHttpsProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_TargetHttpsProxies_SetQuicOverride_sync", "title": "compute SetQuicOverride Sample", @@ -27703,6 +27749,52 @@ } ] }, + { + "regionTag": "compute_v1_generated_TargetSslProxies_SetCertificateMap_sync", + "title": "compute SetCertificateMap Sample", + "description": "SetCertificateMap changes the Certificate Map for TargetSslProxy.", + "file": "TargetSslProxiesClient/SetCertificateMap/main.go", + "language": "GO", + "clientMethod": { + "shortName": "SetCertificateMap", + "fullName": "google.cloud.compute.v1.TargetSslProxiesClient.SetCertificateMap", + "parameters": [ + { + "type": "context.Context", + "name": "ctx" + }, + { + "type": "computepb.SetCertificateMapTargetSslProxyRequest", + "name": "req" + }, + { + "type": "...gax.CallOption", + "name": "opts" + } + ], + "resultType": "Operation", + "client": { + "shortName": "TargetSslProxiesClient", + "fullName": "google.cloud.compute.v1.TargetSslProxiesClient" + }, + "method": { + "shortName": "SetCertificateMap", + "fullName": "google.cloud.compute.v1.TargetSslProxies.SetCertificateMap", + "service": { + "shortName": "TargetSslProxies", + "fullName": "google.cloud.compute.v1.TargetSslProxies" + } + } + }, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 18, + "end": 50, + "type": "FULL" + } + ] + }, { "regionTag": "compute_v1_generated_TargetSslProxies_SetProxyHeader_sync", "title": "compute SetProxyHeader Sample", diff --git a/talent/apiv4beta1/company_client.go b/talent/apiv4beta1/company_client.go index 10e77d79641b..50591480feb8 100644 --- a/talent/apiv4beta1/company_client.go +++ b/talent/apiv4beta1/company_client.go @@ -29,6 +29,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -44,6 +45,7 @@ type CompanyCallOptions struct { UpdateCompany []gax.CallOption DeleteCompany []gax.CallOption ListCompanies []gax.CallOption + GetOperation []gax.CallOption } func defaultCompanyGRPCClientOptions() []option.ClientOption { @@ -98,6 +100,7 @@ func defaultCompanyCallOptions() *CompanyCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, } } @@ -111,6 +114,7 @@ type internalCompanyClient interface { UpdateCompany(context.Context, *talentpb.UpdateCompanyRequest, ...gax.CallOption) (*talentpb.Company, error) DeleteCompany(context.Context, *talentpb.DeleteCompanyRequest, ...gax.CallOption) error ListCompanies(context.Context, *talentpb.ListCompaniesRequest, ...gax.CallOption) *CompanyIterator + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // CompanyClient is a client for interacting with Cloud Talent Solution API. @@ -173,6 +177,11 @@ func (c *CompanyClient) ListCompanies(ctx context.Context, req *talentpb.ListCom return c.internalClient.ListCompanies(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *CompanyClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + // companyGRPCClient is a client for interacting with Cloud Talent Solution API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -189,6 +198,8 @@ type companyGRPCClient struct { // The gRPC API client. companyClient talentpb.CompanyServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -223,6 +234,7 @@ func NewCompanyClient(ctx context.Context, opts ...option.ClientOption) (*Compan disableDeadlines: disableDeadlines, companyClient: talentpb.NewCompanyServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -382,6 +394,21 @@ func (c *companyGRPCClient) ListCompanies(ctx context.Context, req *talentpb.Lis return it } +func (c *companyGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // CompanyIterator manages a stream of *talentpb.Company. type CompanyIterator struct { items []*talentpb.Company diff --git a/talent/apiv4beta1/company_client_example_test.go b/talent/apiv4beta1/company_client_example_test.go index f66b1b767432..5ef40d7de369 100644 --- a/talent/apiv4beta1/company_client_example_test.go +++ b/talent/apiv4beta1/company_client_example_test.go @@ -22,6 +22,7 @@ import ( talent "cloud.google.com/go/talent/apiv4beta1" "google.golang.org/api/iterator" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewCompanyClient() { @@ -139,3 +140,23 @@ func ExampleCompanyClient_ListCompanies() { _ = resp } } + +func ExampleCompanyClient_GetOperation() { + ctx := context.Background() + c, err := talent.NewCompanyClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/talent/apiv4beta1/completion_client.go b/talent/apiv4beta1/completion_client.go index 666ccee8e0df..a381f033d942 100644 --- a/talent/apiv4beta1/completion_client.go +++ b/talent/apiv4beta1/completion_client.go @@ -28,6 +28,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -38,6 +39,7 @@ var newCompletionClientHook clientHook // CompletionCallOptions contains the retry settings for each method of CompletionClient. type CompletionCallOptions struct { CompleteQuery []gax.CallOption + GetOperation []gax.CallOption } func defaultCompletionGRPCClientOptions() []option.ClientOption { @@ -66,6 +68,7 @@ func defaultCompletionCallOptions() *CompletionCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, } } @@ -75,6 +78,7 @@ type internalCompletionClient interface { setGoogleClientInfo(...string) Connection() *grpc.ClientConn CompleteQuery(context.Context, *talentpb.CompleteQueryRequest, ...gax.CallOption) (*talentpb.CompleteQueryResponse, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // CompletionClient is a client for interacting with Cloud Talent Solution API. @@ -117,6 +121,11 @@ func (c *CompletionClient) CompleteQuery(ctx context.Context, req *talentpb.Comp return c.internalClient.CompleteQuery(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *CompletionClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + // completionGRPCClient is a client for interacting with Cloud Talent Solution API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -133,6 +142,8 @@ type completionGRPCClient struct { // The gRPC API client. completionClient talentpb.CompletionClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -167,6 +178,7 @@ func NewCompletionClient(ctx context.Context, opts ...option.ClientOption) (*Com disableDeadlines: disableDeadlines, completionClient: talentpb.NewCompletionClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -218,3 +230,18 @@ func (c *completionGRPCClient) CompleteQuery(ctx context.Context, req *talentpb. } return resp, nil } + +func (c *completionGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/talent/apiv4beta1/completion_client_example_test.go b/talent/apiv4beta1/completion_client_example_test.go index 9fe47e0f6940..d43ddb445197 100644 --- a/talent/apiv4beta1/completion_client_example_test.go +++ b/talent/apiv4beta1/completion_client_example_test.go @@ -21,6 +21,7 @@ import ( talent "cloud.google.com/go/talent/apiv4beta1" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewCompletionClient() { @@ -54,3 +55,23 @@ func ExampleCompletionClient_CompleteQuery() { // TODO: Use resp. _ = resp } + +func ExampleCompletionClient_GetOperation() { + ctx := context.Background() + c, err := talent.NewCompletionClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/talent/apiv4beta1/doc.go b/talent/apiv4beta1/doc.go index c08e5c1247a5..a1293a125af0 100644 --- a/talent/apiv4beta1/doc.go +++ b/talent/apiv4beta1/doc.go @@ -26,7 +26,7 @@ // // To get started with this package, create a client. // ctx := context.Background() -// c, err := talent.NewApplicationClient(ctx) +// c, err := talent.NewCompanyClient(ctx) // if err != nil { // // TODO: Handle error. // } @@ -41,17 +41,17 @@ // The following is an example of making an API call with the newly created client. // // ctx := context.Background() -// c, err := talent.NewApplicationClient(ctx) +// c, err := talent.NewCompanyClient(ctx) // if err != nil { // // TODO: Handle error. // } // defer c.Close() // -// req := &talentpb.CreateApplicationRequest{ +// req := &talentpb.CreateCompanyRequest{ // // TODO: Fill request struct fields. -// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/talent/v4beta1#CreateApplicationRequest. +// // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/talent/v4beta1#CreateCompanyRequest. // } -// resp, err := c.CreateApplication(ctx, req) +// resp, err := c.CreateCompany(ctx, req) // if err != nil { // // TODO: Handle error. // } diff --git a/talent/apiv4beta1/event_client.go b/talent/apiv4beta1/event_client.go index 5b84cfbd0aab..35c7b24183c1 100644 --- a/talent/apiv4beta1/event_client.go +++ b/talent/apiv4beta1/event_client.go @@ -28,6 +28,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) @@ -37,6 +38,7 @@ var newEventClientHook clientHook // EventCallOptions contains the retry settings for each method of EventClient. type EventCallOptions struct { CreateClientEvent []gax.CallOption + GetOperation []gax.CallOption } func defaultEventGRPCClientOptions() []option.ClientOption { @@ -54,6 +56,7 @@ func defaultEventGRPCClientOptions() []option.ClientOption { func defaultEventCallOptions() *EventCallOptions { return &EventCallOptions{ CreateClientEvent: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, } } @@ -63,6 +66,7 @@ type internalEventClient interface { setGoogleClientInfo(...string) Connection() *grpc.ClientConn CreateClientEvent(context.Context, *talentpb.CreateClientEventRequest, ...gax.CallOption) (*talentpb.ClientEvent, error) + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // EventClient is a client for interacting with Cloud Talent Solution API. @@ -110,6 +114,11 @@ func (c *EventClient) CreateClientEvent(ctx context.Context, req *talentpb.Creat return c.internalClient.CreateClientEvent(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *EventClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + // eventGRPCClient is a client for interacting with Cloud Talent Solution API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -126,6 +135,8 @@ type eventGRPCClient struct { // The gRPC API client. eventClient talentpb.EventServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -160,6 +171,7 @@ func NewEventClient(ctx context.Context, opts ...option.ClientOption) (*EventCli disableDeadlines: disableDeadlines, eventClient: talentpb.NewEventServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -211,3 +223,18 @@ func (c *eventGRPCClient) CreateClientEvent(ctx context.Context, req *talentpb.C } return resp, nil } + +func (c *eventGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/talent/apiv4beta1/event_client_example_test.go b/talent/apiv4beta1/event_client_example_test.go index d286f52d3fc6..83c62a235f8b 100644 --- a/talent/apiv4beta1/event_client_example_test.go +++ b/talent/apiv4beta1/event_client_example_test.go @@ -21,6 +21,7 @@ import ( talent "cloud.google.com/go/talent/apiv4beta1" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewEventClient() { @@ -54,3 +55,23 @@ func ExampleEventClient_CreateClientEvent() { // TODO: Use resp. _ = resp } + +func ExampleEventClient_GetOperation() { + ctx := context.Background() + c, err := talent.NewEventClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/talent/apiv4beta1/gapic_metadata.json b/talent/apiv4beta1/gapic_metadata.json index 5bfc350233b6..1ecf7b917ccd 100644 --- a/talent/apiv4beta1/gapic_metadata.json +++ b/talent/apiv4beta1/gapic_metadata.json @@ -5,40 +5,6 @@ "protoPackage": "google.cloud.talent.v4beta1", "libraryPackage": "cloud.google.com/go/talent/apiv4beta1", "services": { - "ApplicationService": { - "clients": { - "grpc": { - "libraryClient": "ApplicationClient", - "rpcs": { - "CreateApplication": { - "methods": [ - "CreateApplication" - ] - }, - "DeleteApplication": { - "methods": [ - "DeleteApplication" - ] - }, - "GetApplication": { - "methods": [ - "GetApplication" - ] - }, - "ListApplications": { - "methods": [ - "ListApplications" - ] - }, - "UpdateApplication": { - "methods": [ - "UpdateApplication" - ] - } - } - } - } - }, "CompanyService": { "clients": { "grpc": { @@ -59,6 +25,11 @@ "GetCompany" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListCompanies": { "methods": [ "ListCompanies" @@ -82,6 +53,11 @@ "methods": [ "CompleteQuery" ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] } } } @@ -96,6 +72,11 @@ "methods": [ "CreateClientEvent" ] + }, + "GetOperation": { + "methods": [ + "GetOperation" + ] } } } @@ -136,6 +117,11 @@ "GetJob" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "ListJobs": { "methods": [ "ListJobs" @@ -160,45 +146,6 @@ } } }, - "ProfileService": { - "clients": { - "grpc": { - "libraryClient": "ProfileClient", - "rpcs": { - "CreateProfile": { - "methods": [ - "CreateProfile" - ] - }, - "DeleteProfile": { - "methods": [ - "DeleteProfile" - ] - }, - "GetProfile": { - "methods": [ - "GetProfile" - ] - }, - "ListProfiles": { - "methods": [ - "ListProfiles" - ] - }, - "SearchProfiles": { - "methods": [ - "SearchProfiles" - ] - }, - "UpdateProfile": { - "methods": [ - "UpdateProfile" - ] - } - } - } - } - }, "TenantService": { "clients": { "grpc": { @@ -214,6 +161,11 @@ "DeleteTenant" ] }, + "GetOperation": { + "methods": [ + "GetOperation" + ] + }, "GetTenant": { "methods": [ "GetTenant" diff --git a/talent/apiv4beta1/job_client.go b/talent/apiv4beta1/job_client.go index b3d581cdb608..ab6cdc7e6f99 100644 --- a/talent/apiv4beta1/job_client.go +++ b/talent/apiv4beta1/job_client.go @@ -52,6 +52,7 @@ type JobCallOptions struct { ListJobs []gax.CallOption SearchJobs []gax.CallOption SearchJobsForAlert []gax.CallOption + GetOperation []gax.CallOption } func defaultJobGRPCClientOptions() []option.ClientOption { @@ -111,6 +112,7 @@ func defaultJobCallOptions() *JobCallOptions { }, SearchJobs: []gax.CallOption{}, SearchJobsForAlert: []gax.CallOption{}, + GetOperation: []gax.CallOption{}, } } @@ -131,6 +133,7 @@ type internalJobClient interface { ListJobs(context.Context, *talentpb.ListJobsRequest, ...gax.CallOption) *JobIterator SearchJobs(context.Context, *talentpb.SearchJobsRequest, ...gax.CallOption) (*talentpb.SearchJobsResponse, error) SearchJobsForAlert(context.Context, *talentpb.SearchJobsRequest, ...gax.CallOption) *SearchJobsResponse_MatchingJobIterator + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // JobClient is a client for interacting with Cloud Talent Solution API. @@ -257,6 +260,11 @@ func (c *JobClient) SearchJobsForAlert(ctx context.Context, req *talentpb.Search return c.internalClient.SearchJobsForAlert(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *JobClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + // jobGRPCClient is a client for interacting with Cloud Talent Solution API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -278,6 +286,8 @@ type jobGRPCClient struct { // Users should not Close this client. LROClient **lroauto.OperationsClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -312,6 +322,7 @@ func NewJobClient(ctx context.Context, opts ...option.ClientOption) (*JobClient, disableDeadlines: disableDeadlines, jobClient: talentpb.NewJobServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -615,6 +626,21 @@ func (c *jobGRPCClient) SearchJobsForAlert(ctx context.Context, req *talentpb.Se return it } +func (c *jobGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // BatchCreateJobsOperation manages a long-running operation from BatchCreateJobs. type BatchCreateJobsOperation struct { lro *longrunning.Operation diff --git a/talent/apiv4beta1/job_client_example_test.go b/talent/apiv4beta1/job_client_example_test.go index fdd1c77e7301..2677fcd9f58a 100644 --- a/talent/apiv4beta1/job_client_example_test.go +++ b/talent/apiv4beta1/job_client_example_test.go @@ -22,6 +22,7 @@ import ( talent "cloud.google.com/go/talent/apiv4beta1" "google.golang.org/api/iterator" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewJobClient() { @@ -253,3 +254,23 @@ func ExampleJobClient_SearchJobsForAlert() { _ = resp } } + +func ExampleJobClient_GetOperation() { + ctx := context.Background() + c, err := talent.NewJobClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +} diff --git a/talent/apiv4beta1/tenant_client.go b/talent/apiv4beta1/tenant_client.go index 82328b3938e4..bf9af7c80456 100644 --- a/talent/apiv4beta1/tenant_client.go +++ b/talent/apiv4beta1/tenant_client.go @@ -29,6 +29,7 @@ import ( "google.golang.org/api/option/internaloption" gtransport "google.golang.org/api/transport/grpc" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" @@ -44,6 +45,7 @@ type TenantCallOptions struct { UpdateTenant []gax.CallOption DeleteTenant []gax.CallOption ListTenants []gax.CallOption + GetOperation []gax.CallOption } func defaultTenantGRPCClientOptions() []option.ClientOption { @@ -98,6 +100,7 @@ func defaultTenantCallOptions() *TenantCallOptions { }) }), }, + GetOperation: []gax.CallOption{}, } } @@ -111,6 +114,7 @@ type internalTenantClient interface { UpdateTenant(context.Context, *talentpb.UpdateTenantRequest, ...gax.CallOption) (*talentpb.Tenant, error) DeleteTenant(context.Context, *talentpb.DeleteTenantRequest, ...gax.CallOption) error ListTenants(context.Context, *talentpb.ListTenantsRequest, ...gax.CallOption) *TenantIterator + GetOperation(context.Context, *longrunningpb.GetOperationRequest, ...gax.CallOption) (*longrunningpb.Operation, error) } // TenantClient is a client for interacting with Cloud Talent Solution API. @@ -172,6 +176,11 @@ func (c *TenantClient) ListTenants(ctx context.Context, req *talentpb.ListTenant return c.internalClient.ListTenants(ctx, req, opts...) } +// GetOperation is a utility method from google.longrunning.Operations. +func (c *TenantClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + return c.internalClient.GetOperation(ctx, req, opts...) +} + // tenantGRPCClient is a client for interacting with Cloud Talent Solution API over gRPC transport. // // Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls. @@ -188,6 +197,8 @@ type tenantGRPCClient struct { // The gRPC API client. tenantClient talentpb.TenantServiceClient + operationsClient longrunningpb.OperationsClient + // The x-goog-* metadata to be sent with each request. xGoogMetadata metadata.MD } @@ -222,6 +233,7 @@ func NewTenantClient(ctx context.Context, opts ...option.ClientOption) (*TenantC disableDeadlines: disableDeadlines, tenantClient: talentpb.NewTenantServiceClient(connPool), CallOptions: &client.CallOptions, + operationsClient: longrunningpb.NewOperationsClient(connPool), } c.setGoogleClientInfo() @@ -381,6 +393,21 @@ func (c *tenantGRPCClient) ListTenants(ctx context.Context, req *talentpb.ListTe return it } +func (c *tenantGRPCClient) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error) { + ctx = insertMetadata(ctx, c.xGoogMetadata) + opts = append((*c.CallOptions).GetOperation[0:len((*c.CallOptions).GetOperation):len((*c.CallOptions).GetOperation)], opts...) + var resp *longrunningpb.Operation + err := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error { + var err error + resp, err = c.operationsClient.GetOperation(ctx, req, settings.GRPC...) + return err + }, opts...) + if err != nil { + return nil, err + } + return resp, nil +} + // TenantIterator manages a stream of *talentpb.Tenant. type TenantIterator struct { items []*talentpb.Tenant diff --git a/talent/apiv4beta1/tenant_client_example_test.go b/talent/apiv4beta1/tenant_client_example_test.go index 31d10f88f816..34f470dad1b5 100644 --- a/talent/apiv4beta1/tenant_client_example_test.go +++ b/talent/apiv4beta1/tenant_client_example_test.go @@ -22,6 +22,7 @@ import ( talent "cloud.google.com/go/talent/apiv4beta1" "google.golang.org/api/iterator" talentpb "google.golang.org/genproto/googleapis/cloud/talent/v4beta1" + longrunningpb "google.golang.org/genproto/googleapis/longrunning" ) func ExampleNewTenantClient() { @@ -139,3 +140,23 @@ func ExampleTenantClient_ListTenants() { _ = resp } } + +func ExampleTenantClient_GetOperation() { + ctx := context.Background() + c, err := talent.NewTenantClient(ctx) + if err != nil { + // TODO: Handle error. + } + defer c.Close() + + req := &longrunningpb.GetOperationRequest{ + // TODO: Fill request struct fields. + // See https://pkg.go.dev/google.golang.org/genproto/googleapis/longrunning#GetOperationRequest. + } + resp, err := c.GetOperation(ctx, req) + if err != nil { + // TODO: Handle error. + } + // TODO: Use resp. + _ = resp +}