Documentation
¶
Index ¶
- Constants
- func NewReuseablePolicySettingsDataSource() datasource.DataSource
- type ReuseablePolicySettingsDataSource
- func (d *ReuseablePolicySettingsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, ...)
- func (r *ReuseablePolicySettingsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, ...)
- func (d *ReuseablePolicySettingsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
- func (d *ReuseablePolicySettingsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, ...)
Constants ¶
View Source
const ( ResourceName = "graph_beta_device_and_app_management_reuseable_policy_setting" ReadTimeout = 180 )
Variables ¶
This section is empty.
Functions ¶
func NewReuseablePolicySettingsDataSource ¶
func NewReuseablePolicySettingsDataSource() datasource.DataSource
Types ¶
type ReuseablePolicySettingsDataSource ¶
type ReuseablePolicySettingsDataSource struct {
ProviderTypeName string
TypeName string
ReadPermissions []string
// contains filtered or unexported fields
}
func (*ReuseablePolicySettingsDataSource) Configure ¶
func (d *ReuseablePolicySettingsDataSource) Configure(ctx context.Context, req datasource.ConfigureRequest, resp *datasource.ConfigureResponse)
func (*ReuseablePolicySettingsDataSource) Metadata ¶
func (r *ReuseablePolicySettingsDataSource) Metadata(ctx context.Context, req datasource.MetadataRequest, resp *datasource.MetadataResponse)
Metadata returns the resource type name.
func (*ReuseablePolicySettingsDataSource) Read ¶
func (d *ReuseablePolicySettingsDataSource) Read(ctx context.Context, req datasource.ReadRequest, resp *datasource.ReadResponse)
Read handles the Read operation for Windows Platform Script data sources.
The function supports two methods of looking up a Windows Platform Script: 1. By ID - Uses a direct API call to fetch the specific script 2. By DisplayName - Lists all scripts and finds the matching one
The function ensures that: - Either ID or DisplayName is provided (but not both) - The lookup method is optimized based on the provided identifier - The remote state is properly mapped to the Terraform state
The function will:
- Extract and validate the configuration
- Verify that exactly one identifier (ID or DisplayName) is provided
- Perform the appropriate API call based on the provided identifier
- Map the remote state to the Terraform state
- Handle any errors and return appropriate diagnostics
If using ID:
- Makes a direct GET request to the specific resource endpoint
- Returns error if the ID is not found
If using DisplayName:
- Retrieves all scripts and searches for matching display name
- Returns error if no matching script is found
func (*ReuseablePolicySettingsDataSource) Schema ¶
func (d *ReuseablePolicySettingsDataSource) Schema(ctx context.Context, req datasource.SchemaRequest, resp *datasource.SchemaResponse)
Click to show internal directories.
Click to hide internal directories.