/
imagestreamimport.go
44 lines (38 loc) · 1.38 KB
/
imagestreamimport.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package internalversion
import (
image "github.com/openshift/origin/pkg/image/apis/image"
rest "k8s.io/client-go/rest"
)
// ImageStreamImportsGetter has a method to return a ImageStreamImportInterface.
// A group's client should implement this interface.
type ImageStreamImportsGetter interface {
ImageStreamImports(namespace string) ImageStreamImportInterface
}
// ImageStreamImportInterface has methods to work with ImageStreamImport resources.
type ImageStreamImportInterface interface {
Create(*image.ImageStreamImport) (*image.ImageStreamImport, error)
ImageStreamImportExpansion
}
// imageStreamImports implements ImageStreamImportInterface
type imageStreamImports struct {
client rest.Interface
ns string
}
// newImageStreamImports returns a ImageStreamImports
func newImageStreamImports(c *ImageClient, namespace string) *imageStreamImports {
return &imageStreamImports{
client: c.RESTClient(),
ns: namespace,
}
}
// Create takes the representation of a imageStreamImport and creates it. Returns the server's representation of the imageStreamImport, and an error, if there is any.
func (c *imageStreamImports) Create(imageStreamImport *image.ImageStreamImport) (result *image.ImageStreamImport, err error) {
result = &image.ImageStreamImport{}
err = c.client.Post().
Namespace(c.ns).
Resource("imagestreamimports").
Body(imageStreamImport).
Do().
Into(result)
return
}