github.com/lukasheimann/cloudfoundrycli@v7.1.0+incompatible/resources/service_instance_resource.go (about)

     1  package resources
     2  
     3  import (
     4  	"code.cloudfoundry.org/jsonry"
     5  )
     6  
     7  type ServiceInstanceType string
     8  
     9  const (
    10  	UserProvidedServiceInstance ServiceInstanceType = "user-provided"
    11  )
    12  
    13  type ServiceInstance struct {
    14  	// Type is either "user-provided" or "managed"
    15  	Type ServiceInstanceType `jsonry:"type,omitempty"`
    16  	// GUID is a unique service instance identifier.
    17  	GUID string `jsonry:"guid,omitempty"`
    18  	// Name is the name of the service instance.
    19  	Name string `jsonry:"name,omitempty"`
    20  	// SpaceGUID is the space that this service instance relates to
    21  	SpaceGUID string `jsonry:"relationships.space.data.guid,omitempty"`
    22  }
    23  
    24  func (s ServiceInstance) MarshalJSON() ([]byte, error) {
    25  	return jsonry.Marshal(s)
    26  }
    27  
    28  func (s *ServiceInstance) UnmarshalJSON(data []byte) error {
    29  	return jsonry.Unmarshal(data, s)
    30  }