(ctx context.Context, image images.Image, fieldpaths ...string)
| 79 | } |
| 80 | |
| 81 | func (s *remoteImages) Update(ctx context.Context, image images.Image, fieldpaths ...string) (images.Image, error) { |
| 82 | var updateMask *ptypes.FieldMask |
| 83 | if len(fieldpaths) > 0 { |
| 84 | updateMask = &ptypes.FieldMask{ |
| 85 | Paths: fieldpaths, |
| 86 | } |
| 87 | } |
| 88 | req := &imagesapi.UpdateImageRequest{ |
| 89 | Image: imageToProto(&image), |
| 90 | UpdateMask: updateMask, |
| 91 | } |
| 92 | if tm := epoch.FromContext(ctx); tm != nil { |
| 93 | req.SourceDateEpoch = timestamppb.New(*tm) |
| 94 | } |
| 95 | updated, err := s.client.Update(ctx, req) |
| 96 | if err != nil { |
| 97 | return images.Image{}, errgrpc.ToNative(err) |
| 98 | } |
| 99 | |
| 100 | return imageFromProto(updated.Image), nil |
| 101 | } |
| 102 | |
| 103 | func (s *remoteImages) Delete(ctx context.Context, name string, opts ...images.DeleteOpt) error { |
| 104 | var do images.DeleteOptions |
nothing calls this directly
no test coverage detected