github.com/mook-as/cf-cli@v7.0.0-beta.28.0.20200120190804-b91c115fae48+incompatible/cf/models/service_instance.go (about)

     1  package models
     2  
     3  type LastOperationFields struct {
     4  	Type        string
     5  	State       string
     6  	Description string
     7  	CreatedAt   string
     8  	UpdatedAt   string
     9  }
    10  
    11  type ServiceInstanceCreateRequest struct {
    12  	Name      string                 `json:"name"`
    13  	SpaceGUID string                 `json:"space_guid"`
    14  	PlanGUID  string                 `json:"service_plan_guid,omitempty"`
    15  	Params    map[string]interface{} `json:"parameters,omitempty"`
    16  	Tags      []string               `json:"tags,omitempty"`
    17  }
    18  
    19  type ServiceInstanceUpdateRequest struct {
    20  	PlanGUID string                 `json:"service_plan_guid,omitempty"`
    21  	Params   map[string]interface{} `json:"parameters,omitempty"`
    22  	Tags     []string               `json:"tags"`
    23  }
    24  
    25  type ServiceInstanceFields struct {
    26  	GUID             string
    27  	Name             string
    28  	LastOperation    LastOperationFields
    29  	SysLogDrainURL   string
    30  	RouteServiceURL  string
    31  	ApplicationNames []string
    32  	Params           map[string]interface{}
    33  	DashboardURL     string
    34  	Type             string
    35  	Tags             []string
    36  }
    37  
    38  type ServiceInstance struct {
    39  	ServiceInstanceFields
    40  	ServiceBindings []ServiceBindingFields
    41  	ServiceKeys     []ServiceKeyFields
    42  	ServicePlan     ServicePlanFields
    43  	ServiceOffering ServiceOfferingFields
    44  }
    45  
    46  func (inst ServiceInstance) IsUserProvided() bool {
    47  	return inst.Type == "user_provided_service_instance"
    48  }