forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice_credential_binding_resource.go
42 lines (36 loc) · 1.58 KB
/
service_credential_binding_resource.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 resources
import (
"code.cloudfoundry.org/cli/types"
"code.cloudfoundry.org/jsonry"
)
type ServiceCredentialBindingType string
const (
AppBinding ServiceCredentialBindingType = "app"
KeyBinding ServiceCredentialBindingType = "key"
)
type ServiceCredentialBinding struct {
// Type is either "app" or "key"
Type ServiceCredentialBindingType `jsonry:"type,omitempty"`
// GUID is a unique service credential binding identifier.
GUID string `jsonry:"guid,omitempty"`
// Name is the name of the service credential binding.
Name string `jsonry:"name,omitempty"`
// ServiceInstanceGUID is the service instance that this binding originates from
ServiceInstanceGUID string `jsonry:"relationships.service_instance.data.guid,omitempty"`
// AppGUID is the application that this binding is attached to
AppGUID string `jsonry:"relationships.app.data.guid,omitempty"`
// AppName is the application name. It is not part of the API response, and is here as pragmatic convenience.
AppName string `jsonry:"-"`
// AppSpaceGUID is the space guid of the app. It is not part of the API response, and is here as pragmatic convenience.
AppSpaceGUID string `jsonry:"-"`
// LastOperation is the last operation on the service credential binding
LastOperation LastOperation `jsonry:"last_operation"`
// Parameters can be specified when creating a binding
Parameters types.OptionalObject `jsonry:"parameters"`
}
func (s ServiceCredentialBinding) MarshalJSON() ([]byte, error) {
return jsonry.Marshal(s)
}
func (s *ServiceCredentialBinding) UnmarshalJSON(data []byte) error {
return jsonry.Unmarshal(data, s)
}