func (c *Client) CreateCloudAccount(ctx context.Context, input *CreateCloudAccountInput) (*CloudAccount, error) {
	var cloudAccount *CloudAccount

	if input.Provider == "AWS" && input.RoleArn == "" {
		return nil, NewError(content.ErrorMissingRoleInformation)
	}
	cloudCreateInput := CloudInfo{
		ExternalID:     input.ExternalID,
		Name:           input.CloudName,
		Arn:            input.RoleArn,
		ScanEnabled:    true,
		ScanRegion:     "All",
		IsDraft:        input.IsDraft,
		Provider:       input.Provider,
		Email:          input.Email,
		UserName:       input.UserName,
		KeyValue:       input.KeyValue,
		ApplicationID:  input.ApplicationID,
		DirectoryID:    input.DirectoryID,
		SubscriptionID: input.SubscriptionID,
		Environment:    input.Environment,
		CSPProjectID:   input.CSPProjectID,
	}
	if input.Tags != "" {
		cloudCreateInput.Tags = strings.Split(input.Tags, "|")
	}
	if input.CSPProjectID == "" {
		cloudCreateInput.CSPProjectID = "default"
	}
	if input.Provider == "AWS" {
		cloudCreateInput.ScanInterval = "Weekly"
	} else if input.Provider == "Azure" {
		cloudCreateInput.ScanInterval = "Daily"
	} else {
		return nil, NewError("Unsupported CloudAccount type")
	}
	cloudAccount, err := c.sendCloudCreateRequest(ctx, &cloudCreateInput)
	if err != nil {
		return nil, err
	}

	if cloudAccount.Provider == "Azure" {
		cloudAccount.AccountID = cloudAccount.SubscriptionID
	}
	return cloudAccount, nil
}
// CreateCloudAccount method to create a cloud object
CreateCloudAccount method to create a cloud object
// CreateCloudAccount method to create a cloud object
func (c *Client) CreateCloudAccount(ctx context.Context, input *CreateCloudAccountInput) (*CloudAccount, error) {
	var cloudAccount *CloudAccount
	if input.Provider == "AWS" && input.RoleArn == "" {
		return nil, NewError(content.ErrorMissingRoleInformation)
	}
	cloudCreateInput := CloudInfo{
		ExternalID:     input.ExternalID,
		Name:           input.CloudName,
		Arn:            input.RoleArn,
		ScanEnabled:    true,
		ScanRegion:     "All",
		IsDraft:        input.IsDraft,
		Provider:       input.Provider,
		Email:          input.Email,
		UserName:       input.UserName,
		KeyValue:       input.KeyValue,
		ApplicationID:  input.ApplicationID,
		DirectoryID:    input.DirectoryID,
		SubscriptionID: input.SubscriptionID,
		Environment:    input.Environment,
		CSPProjectID:   input.CSPProjectID,
	}
	if input.Tags != "" {
		cloudCreateInput.Tags = strings.Split(input.Tags, "|")
	}
	if input.CSPProjectID == "" {
		cloudCreateInput.CSPProjectID = "default"
	}
	if input.Provider == "AWS" {
		cloudCreateInput.ScanInterval = "Weekly"
	} else if input.Provider == "Azure" {
		cloudCreateInput.ScanInterval = "Daily"
	} else {
		return nil, NewError("Unsupported CloudAccount type")
	}
	cloudAccount, err := c.sendCloudCreateRequest(ctx, &cloudCreateInput)
	if err != nil {
		return nil, err
	}
	if cloudAccount.Provider == "Azure" {
		cloudAccount.AccountID = cloudAccount.SubscriptionID
	}
	return cloudAccount, nil
}
func ( c * Client ) CreateCloudAccount ( ctx context . Context , input * CreateCloudAccountInput ) ( * CloudAccount , error ) { var cloudAccount * CloudAccount if input . Provider == " " && input . RoleArn == " " { return nil , NewError ( content . ErrorMissingRoleInformation ) } cloudCreateInput := CloudInfo { ExternalID : input . ExternalID , Name : input . CloudName , Arn : input . RoleArn , ScanEnabled : true , ScanRegion : " " , IsDraft : input . IsDraft , Provider : input . Provider , Email : input . Email , UserName : input . UserName , KeyValue : input . KeyValue , ApplicationID : input . ApplicationID , DirectoryID : input . DirectoryID , SubscriptionID : input . SubscriptionID , Environment : input . Environment , CSPProjectID : input . CSPProjectID , } if input . Tags != " " { cloudCreateInput . Tags = strings . Split ( input . Tags , " " ) } if input . CSPProjectID == " " { cloudCreateInput . CSPProjectID = " " } if input . Provider == " " { cloudCreateInput . ScanInterval = " " } else if input . Provider == " " { cloudCreateInput . ScanInterval = " " } else { return nil , NewError ( " " ) } cloudAccount , err := c . sendCloudCreateRequest ( ctx , & cloudCreateInput ) if err != nil { return nil , err } if cloudAccount . Provider == " " { cloudAccount . AccountID = cloudAccount . SubscriptionID } return cloudAccount , nil }
CreateCloudAccount method to create a cloud object
CreateCloudAccount method to create a cloud object