// DeleteImage deletes a custom image.
352016
func (d *driverOCI) DeleteImage(ctx context.Context, id string) error {
	_, err := d.computeClient.DeleteImage(ctx, core.DeleteImageRequest{ImageId: &id})
	return err
}
1370613
func (m *MockImageAPIClient) ImageRemove(ctx context.Context, image string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
	ret := m.ctrl.Call(m, "ImageRemove", ctx, image, options)
	ret0, _ := ret[0].([]types.ImageDeleteResponseItem)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
548255
func (_m *APIClient) ImageRemove(ctx context.Context, _a1 string, options types.ImageRemoveOptions) ([]types.ImageDeleteResponseItem, error) {
	ret := _m.Called(ctx, _a1, options)

	var r0 []types.ImageDeleteResponseItem
	if rf, ok := ret.Get(0).(func(context.Context, string, types.ImageRemoveOptions) []types.ImageDeleteResponseItem); ok {
		r0 = rf(ctx, _a1, options)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]types.ImageDeleteResponseItem)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, string, types.ImageRemoveOptions) error); ok {
		r1 = rf(ctx, _a1, options)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
630281
func (c *FakeImageSignatures) Delete(name string, options *v1.DeleteOptions) error {
	_, err := c.Fake.
		Invokes(testing.NewRootDeleteAction(imagesignaturesResource, name), &image.ImageSignature{})
	return err
}
132339
func (s *UsersService) DeletePhoto() *UsersDeletePhotoCall {
	var call UsersDeletePhotoCall
	call.service = s
	return &call
}
1334571
func (ds *dockerService) RemoveImage(_ context.Context, r *runtimeapi.RemoveImageRequest) (*runtimeapi.RemoveImageResponse, error) {
	image := r.GetImage()
	// If the image has multiple tags, we need to remove all the tags
	// TODO: We assume image.Image is image ID here, which is true in the current implementation
	// of kubelet, but we should still clarify this in CRI.
	imageInspect, err := ds.client.InspectImageByID(image.Image)

	// dockerclient.InspectImageByID doesn't work with digest and repoTags,
	// it is safe to continue removing it since there is another check below.
	if err != nil && !libdocker.IsImageNotFoundError(err) {
		return nil, err
	}

	if imageInspect == nil {
		// image is nil, assuming it doesn't exist.
		return &runtimeapi.RemoveImageResponse{}, nil
	}

	// An image can have different numbers of RepoTags and RepoDigests.
	// Iterating over both of them plus the image ID ensures the image really got removed.
	// It also prevents images from being deleted, which actually are deletable using this approach.
	var images []string
	images = append(images, imageInspect.RepoTags...)
	images = append(images, imageInspect.RepoDigests...)
	images = append(images, image.Image)

	for _, image := range images {
		if _, err := ds.client.RemoveImage(image, dockertypes.ImageRemoveOptions{PruneChildren: true}); err != nil && !libdocker.IsImageNotFoundError(err) {
			return nil, err
		}
	}

	return &runtimeapi.RemoveImageResponse{}, nil
}
1126066
func (api *ImagesAPI) Delete(imageID string) (task *Task, err error) {
	res, err := api.client.restClient.Delete(api.client.Endpoint+imageUrl+"/"+imageID, api.client.options.TokenOptions)
	if err != nil {
		return
	}
	defer res.Body.Close()
	result, err := getTask(getError(res))
	return result, err
}
950766
func (s *RecognizeCelebritiesInput) SetImage(v *Image) *RecognizeCelebritiesInput {
	s.Image = v
	return s
}
973731
func (s *ImageStoreService) DeleteImageStore(p *DeleteImageStoreParams) (*DeleteImageStoreResponse, error) {
	resp, err := s.cs.newRequest("deleteImageStore", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r DeleteImageStoreResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
1242066
func (t *ImageService) Delete(imageId int) (*ImageResponse, error) {
	u := &url.Values{}
	u.Add("ImageID", strconv.Itoa(imageId))
	v := ImageResponse{}
	if err := t.client.do("image.delete", u, &v.Response); err != nil {
		return nil, err
	}

	v.Image = Image{}
	if err := json.Unmarshal(v.RawData, &v.Image); err != nil {
		return nil, err
	}
	return &v, nil
}
1127235
func (e *Engine) ImageRemove(ctx context.Context, image string, force, prune bool) ([]string, error) {
	opts := dockertypes.ImageRemoveOptions{
		Force:         force,
		PruneChildren: prune,
	}

	removed, err := e.client.ImageRemove(ctx, image, opts)
	r := []string{}
	if err != nil {
		return r, err
	}

	for _, item := range removed {
		if item.Untagged != "" {
			r = append(r, item.Untagged)
		}
		if item.Deleted != "" {
			r = append(r, item.Deleted)
		}
	}

	return r, nil
}
368372
func (s *ProjectEnvironment) SetImage(v string) *ProjectEnvironment {
	s.Image = &v
	return s
}
450847
func (s *Device) SetImage(v string) *Device {
	s.Image = &v
	return s
}
1261148
func (c *Client) Delete(imageId string) error {
	in := params.MetadataImageIds{[]string{imageId}}
	out := params.ErrorResults{}
	err := c.facade.FacadeCall("Delete", in, &out)
	if err != nil {
		return errors.Trace(err)
	}

	result := out.Results
	if len(result) != 1 {
		return errors.Errorf("expected to find one result for image id %q but found %d", imageId, len(result))
	}

	theOne := result[0]
	if theOne.Error != nil {
		return errors.Trace(theOne.Error)
	}
	return nil
}
1295884
func (c *Client) DeleteFile(fileName string) error {
	if c.masterKey == "" {
		return ErrRequiresMasterKey
	}
	resp, err := c.doSimple("DELETE", "/1/files/"+fileName)
	if err != nil {
		return err
	}
	c.trace("DeleteFile", fileName)
	defer resp.Body.Close()
	return nil
}
827253
func (c *Client) LoadImage(opts LoadImageOptions) error {
	return c.stream("POST", "/images/load", streamOptions{
		setRawTerminal: true,
		in:             opts.InputStream,
		stdout:         opts.OutputStream,
		context:        opts.Context,
	})
}
624918
func (s *SetUICustomizationInput) SetImageFile(v []byte) *SetUICustomizationInput {
	s.ImageFile = v
	return s
}