func (c *Client) DestroyConsumedApplication(in DestroyConsumedApplicationParams) ([]params.ErrorResult, error) {
	apiVersion := c.BestAPIVersion()
	args := params.DestroyConsumedApplicationsParams{
		Applications: make([]params.DestroyConsumedApplicationParams, 0, len(in.SaasNames)),
	}

	if apiVersion > 9 {
		if in.MaxWait != nil && !in.Force {
			return nil, errors.New("--force is required when --max-wait is provided")
		}
	} else {
		if in.Force {
			return nil, errors.New("this controller does not support --force")
		}
		if in.MaxWait != nil {
			return nil, errors.New("this controller does not support --no-wait")
		}
	}

	allResults := make([]params.ErrorResult, len(in.SaasNames))
	index := make([]int, 0, len(in.SaasNames))
	for i, name := range in.SaasNames {
		if !names.IsValidApplication(name) {
			allResults[i].Error = &params.Error{
				Message: errors.NotValidf("SAAS application name %q", name).Error(),
			}
			continue
		}
		index = append(index, i)
		appParams := params.DestroyConsumedApplicationParams{
			ApplicationTag: names.NewApplicationTag(name).String(),
		}
		if apiVersion > 9 {
			appParams.Force = &in.Force
			appParams.MaxWait = in.MaxWait
		}
		args.Applications = append(args.Applications, appParams)
	}

	var result params.ErrorResults
	if err := c.facade.FacadeCall("DestroyConsumedApplications", args, &result); err != nil {
		return nil, errors.Trace(err)
	}
	if n := len(result.Results); n != len(args.Applications) {
		return nil, errors.Errorf("expected %d result(s), got %d", len(args.Applications), n)
	}
	for i, result := range result.Results {
		allResults[index[i]] = result
	}
	return allResults, nil
}
// DestroyConsumedApplication destroys the given consumed (remote) applications.
DestroyConsumedApplication destroys the given consumed (remote) applications.
// DestroyConsumedApplication destroys the given consumed ( remote ) applications .
func (c *Client) DestroyConsumedApplication(in DestroyConsumedApplicationParams) ([]params.ErrorResult, error) {
	apiVersion := c.BestAPIVersion()
	args := params.DestroyConsumedApplicationsParams{
		Applications: make([]params.DestroyConsumedApplicationParams, 0, len(in.SaasNames)),
	}
	if apiVersion > 9 {
		if in.MaxWait != nil && !in.Force {
			return nil, errors.New("--force is required when --max-wait is provided")
		}
	} else {
		if in.Force {
			return nil, errors.New("this controller does not support --force")
		}
		if in.MaxWait != nil {
			return nil, errors.New("this controller does not support --no-wait")
		}
	}
	allResults := make([]params.ErrorResult, len(in.SaasNames))
	index := make([]int, 0, len(in.SaasNames))
	for i, name := range in.SaasNames {
		if !names.IsValidApplication(name) {
			allResults[i].Error = &params.Error{
				Message: errors.NotValidf("SAAS application name %q", name).Error(),
			}
			continue
		}
		index = append(index, i)
		appParams := params.DestroyConsumedApplicationParams{
			ApplicationTag: names.NewApplicationTag(name).String(),
		}
		if apiVersion > 9 {
			appParams.Force = &in.Force
			appParams.MaxWait = in.MaxWait
		}
		args.Applications = append(args.Applications, appParams)
	}
	var result params.ErrorResults
	if err := c.facade.FacadeCall("DestroyConsumedApplications", args, &result); err != nil {
		return nil, errors.Trace(err)
	}
	if n := len(result.Results); n != len(args.Applications) {
		return nil, errors.Errorf("expected %d result(s), got %d", len(args.Applications), n)
	}
	for i, result := range result.Results {
		allResults[index[i]] = result
	}
	return allResults, nil
}
func ( c * Client ) DestroyConsumedApplication ( in DestroyConsumedApplicationParams ) ( [ ] params . ErrorResult , error ) { apiVersion := c . BestAPIVersion ( ) args := params . DestroyConsumedApplicationsParams { Applications : make ( [ ] params . DestroyConsumedApplicationParams , 0 , len ( in . SaasNames ) ) , } if apiVersion > 9 { if in . MaxWait != nil && ! in . Force { return nil , errors . New ( " " ) } } else { if in . Force { return nil , errors . New ( " " ) } if in . MaxWait != nil { return nil , errors . New ( " " ) } } allResults := make ( [ ] params . ErrorResult , len ( in . SaasNames ) ) index := make ( [ ] int , 0 , len ( in . SaasNames ) ) for i , name := range in . SaasNames { if ! names . IsValidApplication ( name ) { allResults [ i ] . Error = & params . Error { Message : errors . NotValidf ( " " , name ) . Error ( ) , } continue } index = append ( index , i ) appParams := params . DestroyConsumedApplicationParams { ApplicationTag : names . NewApplicationTag ( name ) . String ( ) , } if apiVersion > 9 { appParams . Force = & in . Force appParams . MaxWait = in . MaxWait } args . Applications = append ( args . Applications , appParams ) } var result params . ErrorResults if err := c . facade . FacadeCall ( " " , args , & result ) ; err != nil { return nil , errors . Trace ( err ) } if n := len ( result . Results ) ; n != len ( args . Applications ) { return nil , errors . Errorf ( " " , len ( args . Applications ) , n ) } for i , result := range result . Results { allResults [ index [ i ] ] = result } return allResults , nil }
DestroyConsumedApplication destroys the given consumed (remote) applications.
DestroyConsumedApplication destroys the given consumed ( remote ) applications .