github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/cloudcontroller/ccv3/build.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  // CreateBuild creates the given build, requires Package GUID to be set on the
     9  // build.
    10  func (client *Client) CreateBuild(build resources.Build) (resources.Build, Warnings, error) {
    11  	var responseBody resources.Build
    12  
    13  	_, warnings, err := client.MakeRequest(RequestParams{
    14  		RequestName:  internal.PostBuildRequest,
    15  		RequestBody:  build,
    16  		ResponseBody: &responseBody,
    17  	})
    18  
    19  	return responseBody, warnings, err
    20  }
    21  
    22  // GetBuild gets the build with the given GUID.
    23  func (client *Client) GetBuild(guid string) (resources.Build, Warnings, error) {
    24  	var responseBody resources.Build
    25  
    26  	_, warnings, err := client.MakeRequest(RequestParams{
    27  		RequestName:  internal.GetBuildRequest,
    28  		URIParams:    internal.Params{"build_guid": guid},
    29  		ResponseBody: &responseBody,
    30  	})
    31  
    32  	return responseBody, warnings, err
    33  }