github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccv3/service_plan_visibility.go (about)

     1  package ccv3
     2  
     3  import (
     4  	"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3/internal"
     5  	"code.cloudfoundry.org/cli/resources"
     6  )
     7  
     8  func (client *Client) GetServicePlanVisibility(servicePlanGUID string) (resources.ServicePlanVisibility, Warnings, error) {
     9  	var result resources.ServicePlanVisibility
    10  
    11  	_, warnings, err := client.MakeRequest(RequestParams{
    12  		RequestName:  internal.GetServicePlanVisibilityRequest,
    13  		URIParams:    internal.Params{"service_plan_guid": servicePlanGUID},
    14  		ResponseBody: &result,
    15  	})
    16  
    17  	return result, warnings, err
    18  }
    19  
    20  func (client *Client) UpdateServicePlanVisibility(servicePlanGUID string, planVisibility resources.ServicePlanVisibility) (resources.ServicePlanVisibility, Warnings, error) {
    21  	var result resources.ServicePlanVisibility
    22  
    23  	_, warnings, err := client.MakeRequest(RequestParams{
    24  		RequestName:  internal.PostServicePlanVisibilityRequest,
    25  		URIParams:    internal.Params{"service_plan_guid": servicePlanGUID},
    26  		RequestBody:  planVisibility,
    27  		ResponseBody: &result,
    28  	})
    29  
    30  	return result, warnings, err
    31  }
    32  
    33  func (client *Client) DeleteServicePlanVisibility(servicePlanGUID, organizationGUID string) (Warnings, error) {
    34  
    35  	_, warnings, err := client.MakeRequest(RequestParams{
    36  		RequestName: internal.DeleteServicePlanVisibilityRequest,
    37  		URIParams:   internal.Params{"service_plan_guid": servicePlanGUID, "organization_guid": organizationGUID},
    38  	})
    39  
    40  	return warnings, err
    41  }