Skip to content

Commit

Permalink
Add DeleteAssociatedResources parameter to accounts delete endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
tirthct committed Jun 26, 2023
1 parent c6bad55 commit ea44453
Show file tree
Hide file tree
Showing 4 changed files with 10,900 additions and 10,872 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.293
model_version:=v0.0.294
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
18 changes: 14 additions & 4 deletions accountsmgmt/v1/account_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,11 @@ func (c *AccountClient) Poll() *AccountPollRequest {

// AccountDeleteRequest is the request for the 'delete' method.
type AccountDeleteRequest struct {
transport http.RoundTripper
path string
query url.Values
header http.Header
transport http.RoundTripper
path string
query url.Values
header http.Header
deleteAssociatedResources *bool
}

// Parameter adds a query parameter.
Expand All @@ -233,6 +234,12 @@ func (r *AccountDeleteRequest) Impersonate(user string) *AccountDeleteRequest {
return r
}

// DeleteAssociatedResources sets the value of the 'delete_associated_resources' parameter.
func (r *AccountDeleteRequest) DeleteAssociatedResources(value bool) *AccountDeleteRequest {
r.deleteAssociatedResources = &value
return r
}

// Send sends this request, waits for the response, and returns it.
//
// This is a potentially lengthy operation, as it requires network communication.
Expand All @@ -244,6 +251,9 @@ func (r *AccountDeleteRequest) Send() (result *AccountDeleteResponse, err error)
// SendContext sends this request, waits for the response, and returns it.
func (r *AccountDeleteRequest) SendContext(ctx context.Context) (result *AccountDeleteResponse, err error) {
query := helpers.CopyQuery(r.query)
if r.deleteAssociatedResources != nil {
helpers.AddValue(&query, "delete_associated_resources", *r.deleteAssociatedResources)
}
header := helpers.CopyHeader(r.header)
uri := &url.URL{
Path: r.path,
Expand Down
Loading

0 comments on commit ea44453

Please sign in to comment.