-
Notifications
You must be signed in to change notification settings - Fork 929
/
service_instance_user_provided.go
42 lines (33 loc) · 1.25 KB
/
service_instance_user_provided.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
package v2action
import (
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv2"
)
// UserProvidedServiceInstance represents an instance of a user-provided service.
type UserProvidedServiceInstance ccv2.UserProvidedServiceInstance
func (u UserProvidedServiceInstance) WithTags(tags []string) UserProvidedServiceInstance {
if tags == nil {
tags = []string{}
}
u.Tags = &tags
return u
}
func (u UserProvidedServiceInstance) WithSyslogDrainURL(url string) UserProvidedServiceInstance {
u.SyslogDrainURL = &url
return u
}
func (u UserProvidedServiceInstance) WithRouteServiceURL(url string) UserProvidedServiceInstance {
u.RouteServiceURL = &url
return u
}
func (u UserProvidedServiceInstance) WithCredentials(creds map[string]interface{}) UserProvidedServiceInstance {
if creds == nil {
creds = make(map[string]interface{})
}
u.Credentials = creds
return u
}
// UpdateUserProvidedServiceInstance requests that the service instance be updated with the specified data
func (actor Actor) UpdateUserProvidedServiceInstance(guid string, instance UserProvidedServiceInstance) (Warnings, error) {
warnings, err := actor.CloudControllerClient.UpdateUserProvidedServiceInstance(guid, ccv2.UserProvidedServiceInstance(instance))
return Warnings(warnings), err
}