This PR incorporates various fixes and improvements to both the MS Graph Importer and Go SDK Generator, enabling the generation of a Microsoft Graph SDK.
⚠️ Breaking Changes
References to model interfaces in response structs for methods were previously *interface{}, these are now interface{}. This affects Resource Manager and Microsoft Graph SDKs.
Summary of Changes
Repository / Tooling
Add workflows for MS Graph import + generation
Update workflow triggers as we don't need to run every workflow on every change
Go SDK Generator
Support for generating a Microsoft Graph SDK (and future data plane SDKs with custom base clients)
Support for generating Common Types
Support for common types in all references (models, options, methods etc)
Support for generating OData request options
Support for generating nullable model fields using the go-azure-sdk/sdk/nullable types
Allows fields to be non-zero, zero-value, explicitly null, or omitted, all at the same time.
Implement support for read-only fields
Improvements to discriminated models
Define a base struct type for parent models
Support for unmarshaling parent models directly in methods
Output the discriminated field and unmarshal it, instead of hiding it
Implement a method on discriminated type interfaces to return a struct for the parent model
Embed parent model interfaces where ancestry spans multiple generations
Implement fields from all ancestors in child model structs
Ability for child models to return standalone representations of any ancestor (enforced by parent interfaces)
Output comments for operations
Wrap model/operation comments at 120 columns for prettier output
Handle arbitrary API version strings in addition to Y-m-d[-preview] convention
Add missing imports to generated code, other performance improvements
Fix some race conditions
MS Graph Importer
Update to latest msgraph-metadata submodule
Rewrite the model parsing functions to be more selective and opinionated
Fully support model inheritence with SDK compatibility in mind
Support constant and model references in operations
Move all resource IDs into Common Types
Clean up the "ById" suffix hack
Handle different content types for responses
Handle OData headers and request parameters, and other query params
Blacklist some resources with irreconcilable paths/IDs
Various fixes for casing and singularization/pluralization
Improved method naming, particularly around OData functions
Support for nullable field types
Support for required and read-only fields
Generate descriptions for operations and model fields
Add @odata.id and @odata.type fields to every model
Add an @odata.bind field for DirectoryObject references
Remove microsoft.graph. prefix on action URL suffixes
Support for discrimination, automatically infer all discriminated models
Improved model and constant naming
Support for data workarounds in models and constants
Add workaround for broken field name in Application model
Add workarounds for ConditionalAccessPolicy to enable correct behavior with nullable fields
Workaround for invalid resource IDs with repeating segments (which aren't supported)
Support for workarounds in service/resource definitions
Add workaround for Synchronization Secrets (GET method missing in metadata)
Supported Services
Applications
Application Management
Federated Identity Credentials
Synchronization (incl. jobs, secrets, templates)
Token Issuance Policy
Token Lifetime Policy
Application Templates
Audit Logs
Device Management
Directory
Administrative Units (incl. extensions, members)
Attribute Sets
Custom Security Attributes
Federation
On Premises Sync
Subscriptions
Directory Objects
Directory Roles
Directory Role Templates
Domains
Groups
Group Management
App Role Assignments
OneDrive
Permission Grants
Teams
Identity
Authentication Events
B2x User Flows
Conditional Access
Authentication Strength Policies,
Named Locations
Policies
Identity Providers
User Flow Attributes
Identity Governance
Access Reviews
App Consent
Entitlement Management
Access packages
Assignments & Policies
Requests
Catalogs
Connected Organizations
Resource Environments
Resource Requests
Resource Roles/Scopes
Settings
Identity Governance
Lifecycle Workflows
Privileged Access
Terms of Use
Invitations
"Me"
Near-complete API support from various services
OAuth2 Permission Grants
Policies
Activity-based Timeout Policy
Admin Consent Request Policy
App Management Policy
Authentication Flows Policy
Authentication Methods Policy
Authentication Strength Policy
Authorization Policy
Claims Mapping Policy
Conditional Access Policy
Cross Tenant Access Policy
Device Registration Policy
Feature Rollout Policy
Home Realm Discovery Policy
Permission Grant Policy
Role Management Policy
Token Issuance Policy
Token Lifetime Policy
Reports
Authentication Methods
Print Usages
Partners
Security
Role Management
Directory Roles
Assignment Roles
Assignment Schedules
Role Definitions
Role Eligibility
Entitlement Management
Assignments
Definitions
Eligibility
Schema Extensions
Service Principals
Service Principal Management
App Management Policy
App Role Assignments
Claims Mapping Policy
Federated Identity Credentials
Home Realm Discovery Policy
OAuth2 Permission Grants
Synchronization (incl. jobs, secrets, templates)
Token Issuance Policy
Token Lifetime Policy
Users
User Management
Activity
App Role Assignments
Authentication
Calendars
Chat
Contact
Employee Experience
Events
Extensions
Insights
Licenses
Mail
Managed Devices
OAuth2 Permission Grants
OneDrive
Online Meetings
Outlook
Settings
Teams
Todos
Generated SDK Improvements
Comments for model fields
Comments for operation methods
Nullable fields support
Read-Only fields support
Ability to obtain an ancestor model representation for discriminated models
Support for OData options (headers and query params)
Depends on: https://github.com/hashicorp/go-azure-sdk/pull/1058
This PR incorporates various fixes and improvements to both the MS Graph Importer and Go SDK Generator, enabling the generation of a Microsoft Graph SDK.
⚠️ Breaking Changes
*interface{}
, these are nowinterface{}
. This affects Resource Manager and Microsoft Graph SDKs.Summary of Changes
Repository / Tooling
Go SDK Generator
go-azure-sdk/sdk/nullable
typesY-m-d[-preview]
conventionMS Graph Importer
msgraph-metadata
submodule@odata.id
and@odata.type
fields to every model@odata.bind
field forDirectoryObject
referencesmicrosoft.graph.
prefix on action URL suffixesApplication
modelConditionalAccessPolicy
to enable correct behavior with nullable fieldsSupported Services
Generated SDK Improvements
Comments for model fields
Comments for operation methods
Nullable fields support
Read-Only fields support
Ability to obtain an ancestor model representation for discriminated models
Support for OData options (headers and query params)
Outstanding Items
generator-go-sdk
resource-manager
SDK