Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat intune settings templates #219

Merged
merged 4 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/metadata-maintainence.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ jobs:
- name: Get current time
id: current-time
run: |
echo "time=$(date -u '+%Y-%m-%d %H:%M:%S UTC')" >> $GITHUB_OUTPUT
echo "time=$(date -u '+%Y-%m-%d_%H-%M-%S')" >> $GITHUB_OUTPUT

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update MS Graph Metadata
title: 'Update Graph Metadata - ${{ steps.current-time.outputs.time }}'
body: |
This is an automated pull request to update the Graph meta data.
This is an automated pull request to update graph meta data.

Generated on: ${{ steps.current-time.outputs.time }}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"@odata.type": "#microsoft.graph.deviceManagementTemplate",
"displayName": "Display Name value",
"description": "Description value",
"versionInfo": "Version Info value",
"isDeprecated": true,
"intentCount": 11,
"templateType": "specializedDevices",
"platformType": "androidForWork",
"templateSubtype": "firewall",
"publishedDateTime": "2016-12-31T23:58:16.1180489-08:00"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package graphBetaEndpointPrivilegeManagement

import (
"context"
"fmt"

"github.com/deploymenttheory/terraform-provider-microsoft365/internal/resources/common/construct"
"github.com/hashicorp/terraform-plugin-log/tflog"

"github.com/microsoftgraph/msgraph-beta-sdk-go/models"
)

// constructResource maps the Terraform schema to the SDK model
func constructResource(ctx context.Context, typeName string, data *AssignmentFilterResourceModel) (*models.DeviceAndAppManagementAssignmentFilter, error) {
tflog.Debug(ctx, fmt.Sprintf("Constructing %s resource from model", ResourceName))

requestBody := models.NewDeviceAndAppManagementAssignmentFilter()

displayName := data.DisplayName.ValueString()
requestBody.SetDisplayName(&displayName)

// add more fields here as needed

if err := construct.DebugLogGraphObject(ctx, fmt.Sprintf("Final JSON to be sent to Graph API for resource %s", ResourceName), requestBody); err != nil {
tflog.Error(ctx, "Failed to debug log object", map[string]interface{}{
"error": err.Error(),
})
}

tflog.Debug(ctx, fmt.Sprintf("Finished constructing %s resource", ResourceName))

return requestBody, nil
}
Loading