func (e *ActivityLogExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult {
	method := "GET"
	data, err := armclient.DoRequest(ctx, method, currentItem.ExpandURL)
	if err != nil {
		return ExpanderResult{
			Err:               err,
			Response:          "",
			SourceDescription: "Activity Log",
			IsPrimaryResponse: true,
		}
	}
	newItems := []*TreeNode{}

	var activityLogs armclient.ActivityLogResource
	err = json.Unmarshal([]byte(data), &activityLogs)
	if err != nil {
		panic(err)
	}

	value, err := fastJSONParser.Parse(data)
	if err != nil {
		panic(err)
	}

	for i, log := range activityLogs.Value {
		// Update the existing state as we have more up-to-date info
		objectJSON := string(value.GetArray("value")[i].MarshalTo([]byte("")))

		newItems = append(newItems, &TreeNode{
			Name:            log.OperationName.Value,
			Display:         log.OperationName.LocalizedValue + "\n   " + style.Subtle("At:  "+log.EventTimestamp.String()) + "\n   " + style.Subtle("ResourceType: "+log.ResourceType.Value) + "\n   " + style.Subtle("Status: "+log.Status.Value+""),
			ID:              log.ID,
			Parentid:        currentItem.ID,
			ExpandURL:       ExpandURLNotSupported,
			ItemType:        subDeploymentType,
			SubscriptionID:  currentItem.SubscriptionID,
			StatusIndicator: DrawStatus(log.Status.Value),
			Metadata: map[string]string{
				"jsonItem": objectJSON,
			},
		})
	}

	return ExpanderResult{
		Err:               err,
		Response:          string(data),
		SourceDescription: "Deployments request",
		Nodes:             newItems,
		IsPrimaryResponse: true,
	}
}
// Expand returns Resources in the RG
Expand returns Resources in the RG
// Expand returns Resources in the RG
func (e *ActivityLogExpander) Expand(ctx context.Context, currentItem *TreeNode) ExpanderResult {
	method := "GET"
	data, err := armclient.DoRequest(ctx, method, currentItem.ExpandURL)
	if err != nil {
		return ExpanderResult{
			Err:               err,
			Response:          "",
			SourceDescription: "Activity Log",
			IsPrimaryResponse: true,
		}
	}
	newItems := []*TreeNode{}
	var activityLogs armclient.ActivityLogResource
	err = json.Unmarshal([]byte(data), &activityLogs)
	if err != nil {
		panic(err)
	}
	value, err := fastJSONParser.Parse(data)
	if err != nil {
		panic(err)
	}
	for i, log := range activityLogs.Value {
		objectJSON := string(value.GetArray("value")[i].MarshalTo([]byte("")))
		newItems = append(newItems, &TreeNode{
			Name:            log.OperationName.Value,
			Display:         log.OperationName.LocalizedValue + "\n   " + style.Subtle("At:  "+log.EventTimestamp.String()) + "\n   " + style.Subtle("ResourceType: "+log.ResourceType.Value) + "\n   " + style.Subtle("Status: "+log.Status.Value+""),
			ID:              log.ID,
			Parentid:        currentItem.ID,
			ExpandURL:       ExpandURLNotSupported,
			ItemType:        subDeploymentType,
			SubscriptionID:  currentItem.SubscriptionID,
			StatusIndicator: DrawStatus(log.Status.Value),
			Metadata: map[string]string{
				"jsonItem": objectJSON,
			},
		})
	}
	return ExpanderResult{
		Err:               err,
		Response:          string(data),
		SourceDescription: "Deployments request",
		Nodes:             newItems,
		IsPrimaryResponse: true,
	}
}
func ( e * ActivityLogExpander ) Expand ( ctx context . Context , currentItem * TreeNode ) ExpanderResult { method := " " data , err := armclient . DoRequest ( ctx , method , currentItem . ExpandURL ) if err != nil { return ExpanderResult { Err : err , Response : " " , SourceDescription : " " , IsPrimaryResponse : true , } } newItems := [ ] * TreeNode { } var activityLogs armclient . ActivityLogResource err = json . Unmarshal ( [ ] byte ( data ) , & activityLogs ) if err != nil { panic ( err ) } value , err := fastJSONParser . Parse ( data ) if err != nil { panic ( err ) } for i , log := range activityLogs . Value { objectJSON := string ( value . GetArray ( " " ) [ i ] . MarshalTo ( [ ] byte ( " " ) ) ) newItems = append ( newItems , & TreeNode { Name : log . OperationName . Value , Display : log . OperationName . LocalizedValue + " \n " + style . Subtle ( " " + log . EventTimestamp . String ( ) ) + " \n " + style . Subtle ( " " + log . ResourceType . Value ) + " \n " + style . Subtle ( " " + log . Status . Value + " " ) , ID : log . ID , Parentid : currentItem . ID , ExpandURL : ExpandURLNotSupported , ItemType : subDeploymentType , SubscriptionID : currentItem . SubscriptionID , StatusIndicator : DrawStatus ( log . Status . Value ) , Metadata : map [ string ] string { " " : objectJSON , } , } ) } return ExpanderResult { Err : err , Response : string ( data ) , SourceDescription : " " , Nodes : newItems , IsPrimaryResponse : true , } }
Expand returns Resources in the RG
Expand returns Resources in the RG
// Update the existing state as we have more up-to-date info