github.com/sleungcy-sap/cli@v7.1.0+incompatible/resources/service_broker_resource.go (about)

     1  package resources
     2  
     3  import (
     4  	"code.cloudfoundry.org/jsonry"
     5  )
     6  
     7  type ServiceBrokerCredentialsType string
     8  
     9  const (
    10  	ServiceBrokerBasicCredentials ServiceBrokerCredentialsType = "basic"
    11  )
    12  
    13  type ServiceBroker struct {
    14  	// GUID is a unique service broker identifier.
    15  	GUID string `json:"guid,omitempty"`
    16  	// Name is the name of the service broker.
    17  	Name string `json:"name,omitempty"`
    18  	// URL is the url of the service broker.
    19  	URL string `json:"url,omitempty"`
    20  	// CredentialsType is always "basic"
    21  	CredentialsType ServiceBrokerCredentialsType `jsonry:"authentication.type,omitempty"`
    22  	// Username is the Basic Auth username for the service broker.
    23  	Username string `jsonry:"authentication.credentials.username,omitempty"`
    24  	// Password is the Basic Auth password for the service broker.
    25  	Password string `jsonry:"authentication.credentials.password,omitempty"`
    26  	// Space GUID for the space that the broker is in. Empty when not a space-scoped service broker.
    27  	SpaceGUID string `jsonry:"relationships.space.data.guid,omitempty"`
    28  
    29  	Metadata *Metadata `json:"metadata,omitempty"`
    30  }
    31  
    32  func (s ServiceBroker) MarshalJSON() ([]byte, error) {
    33  	return jsonry.Marshal(s)
    34  }
    35  
    36  func (s *ServiceBroker) UnmarshalJSON(data []byte) error {
    37  	return jsonry.Unmarshal(data, s)
    38  }