diff --git a/blueprints/thousandeyes-kiota/resources/tests_agent_to_agent.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_agent_to_agent.blueprint.json new file mode 100644 index 00000000..ccd08bb7 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_agent_to_agent.blueprint.json @@ -0,0 +1,1677 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_agent_to_agent", + "name": "tests_agent_to_agent", + "goPackage": "tests_agent_to_agent", + "goPackageAlias": "v7TestsAgentToAgent", + "goTypeName": "TestsAgentToAgentResource", + "modelTypeName": "TestsAgentToAgentResourceModel", + "serviceGroup": "agent_to_agent_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToAgentAlertRuleModel", + "sdkType": "agent_to_agent_tests.AlertRule", + "attrTypesVar": "testsAgentToAgentAlertRuleAttrTypes", + "objectTypeVar": "testsAgentToAgentAlertRuleObjectType", + "expandFunc": "expandTestsAgentToAgentAlertRules", + "flattenFunc": "flattenTestsAgentToAgentAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "agent_to_agent_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_agent_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "agent_to_agent_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_agent_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "agent_to_agent_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "agent_to_agent_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "agent_to_agent_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_agent_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]agent_to_agent_tests.AlertRule", + "expand": { + "func": "expandTestsAgentToAgentAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAgentToAgentAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates if alerts are enabled.", + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction of the test, which affects how results are shown.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "*models.Tests_API_TestDirection", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDirection" + ], + "extraArgs": [ + "models.ParseTests_API_TestDirection" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "dscp", + "goField": "Dscp", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "DSCP label.", + "wire": { + "jsonPath": "dscp", + "sdkField": "Dscp", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "dscp_id", + "goField": "DscpID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "8", + "16", + "24", + "32", + "40", + "48", + "56", + "10", + "12", + "14", + "18", + "20", + "22", + "26", + "28", + "30", + "34", + "36", + "38", + "46", + "44" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests)\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dscpId", + "sdkField": "DscpId", + "sdkGoType": "*models.Tests_API_TestDscpId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDscpId" + ], + "extraArgs": [ + "models.ParseTests_API_TestDscpId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Test is enabled.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToAgentTestLabelsModel", + "sdkType": "agent_to_agent_tests.TestLabels", + "attrTypesVar": "testsAgentToAgentTestLabelsAttrTypes", + "objectTypeVar": "testsAgentToAgentTestLabelsObjectType", + "expandFunc": "expandTestsAgentToAgentTestLabelses", + "flattenFunc": "flattenTestsAgentToAgentTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]agent_to_agent_tests.TestLabels", + "flatten": { + "func": "flattenTestsAgentToAgentTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToAgentTestBGPMonitorsModel", + "sdkType": "agent_to_agent_tests.TestBgpMonitors", + "attrTypesVar": "testsAgentToAgentTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsAgentToAgentTestBGPMonitorsObjectType", + "expandFunc": "expandTestsAgentToAgentTestBGPMonitorses", + "flattenFunc": "flattenTestsAgentToAgentTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "agent_to_agent_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]agent_to_agent_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsAgentToAgentTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mss", + "goField": "Mss", + "type": { + "kind": "int64", + "constraints": { + "minimum": 20, + "maximum": 1400 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Maximum segment size, in bytes.", + "wire": { + "jsonPath": "mss", + "sdkField": "Mss", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "port", + "goField": "Port", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 65535 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target port.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "port", + "sdkField": "Port", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "udp" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_AgentToAgentTestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_AgentToAgentTestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_AgentToAgentTestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToAgentTestSharedAccountsModel", + "sdkType": "agent_to_agent_tests.TestSharedAccounts", + "attrTypesVar": "testsAgentToAgentTestSharedAccountsAttrTypes", + "objectTypeVar": "testsAgentToAgentTestSharedAccountsObjectType", + "expandFunc": "expandTestsAgentToAgentTestSharedAccountses", + "flattenFunc": "flattenTestsAgentToAgentTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]agent_to_agent_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsAgentToAgentTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToAgentTestTagsModel", + "sdkType": "agent_to_agent_tests.TestTags", + "attrTypesVar": "testsAgentToAgentTestTagsAttrTypes", + "objectTypeVar": "testsAgentToAgentTestTagsObjectType", + "expandFunc": "expandTestsAgentToAgentTestTagses", + "flattenFunc": "flattenTestsAgentToAgentTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]agent_to_agent_tests.TestTags", + "flatten": { + "func": "flattenTestsAgentToAgentTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "target_agent_id", + "goField": "TargetAgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "`agentId` of the target agent for the test.", + "wire": { + "jsonPath": "targetAgentId", + "sdkField": "TargetAgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The name of the test. Test name must be unique.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "throughput_duration", + "goField": "ThroughputDuration", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5000, + "maximum": 30000 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The throughput duration.", + "wire": { + "jsonPath": "throughputDuration", + "sdkField": "ThroughputDuration", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "throughput_measurements", + "goField": "ThroughputMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent.", + "wire": { + "jsonPath": "throughputMeasurements", + "sdkField": "ThroughputMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "throughput_rate", + "goField": "ThroughputRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 8, + "maximum": 1000 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The throughput rate, only applicable for UDP protocol.", + "wire": { + "jsonPath": "throughputRate", + "sdkField": "ThroughputRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "AgentToAgentAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "agentToAgentAgentAttrTypes", + "objectTypeVar": "agentToAgentAgentObjectType", + "expandFunc": "expandAgentToAgentAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.", + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandAgentToAgentAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get Agent to Agent test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToAgent" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_AgentToAgentTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/agent-to-agent" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToAgent" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_AgentToAgentTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/agent-to-agent/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToAgent" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_AgentToAgentTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/agent-to-agent/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToAgent" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/agent-to-agent/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_AgentToAgentTestRequest", + "responseType": "models.Tests_API_AgentToAgentTestResponseable", + "constructorExpr": "models.NewTests_API_AgentToAgentTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + } + ] + }, + "accTest": { + "skipUnlessEnv": "TFPFGEN_ACC_ENTERPRISE" + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_agent_to_server.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_agent_to_server.blueprint.json new file mode 100644 index 00000000..4378fb17 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_agent_to_server.blueprint.json @@ -0,0 +1,1749 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_agent_to_server", + "name": "tests_agent_to_server", + "goPackage": "tests_agent_to_server", + "goPackageAlias": "v7TestsAgentToServer", + "goTypeName": "TestsAgentToServerResource", + "modelTypeName": "TestsAgentToServerResourceModel", + "serviceGroup": "agent_to_server_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToServerAlertRuleModel", + "sdkType": "agent_to_server_tests.AlertRule", + "attrTypesVar": "testsAgentToServerAlertRuleAttrTypes", + "objectTypeVar": "testsAgentToServerAlertRuleObjectType", + "expandFunc": "expandTestsAgentToServerAlertRules", + "flattenFunc": "flattenTestsAgentToServerAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "agent_to_server_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_server_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "agent_to_server_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_server_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "agent_to_server_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "agent_to_server_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "agent_to_server_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "agent_to_server_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]agent_to_server_tests.AlertRule", + "expand": { + "func": "expandTestsAgentToServerAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAgentToServerAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "continuous_mode", + "goField": "ContinuousMode", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "To enable continuous monitoring, set this parameter to `true` to. \nWhen continuous monitoring is enabled, the following actions occur:\n* `fixedPacketRate` is enforced\n* `bandwidthMeasurements` are disabled\n* If the `protocol` is set to `tcp`, `probeMode` is set to `syn`.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + } + }, + "wire": { + "jsonPath": "continuousMode", + "sdkField": "ContinuousMode", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "dscp", + "goField": "Dscp", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "DSCP label.", + "wire": { + "jsonPath": "dscp", + "sdkField": "Dscp", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "dscp_id", + "goField": "DscpID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "8", + "16", + "24", + "32", + "40", + "48", + "56", + "10", + "12", + "14", + "18", + "20", + "22", + "26", + "28", + "30", + "34", + "36", + "38", + "46", + "44" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests)\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dscpId", + "sdkField": "DscpId", + "sdkGoType": "*models.Tests_API_TestDscpId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDscpId" + ], + "extraArgs": [ + "models.ParseTests_API_TestDscpId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1`", + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ipv6_policy", + "goField": "Ipv6Policy", + "type": { + "kind": "string", + "allowedValues": [ + "force-ipv4", + "prefer-ipv6", + "force-ipv6", + "use-agent-policy" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "IP version policy. Overrides the IPv6 policy configured at the agent level.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "ipv6Policy", + "sdkField": "Ipv6Policy", + "sdkGoType": "*models.Tests_API_TestIpv6Policy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestIpv6Policy" + ], + "extraArgs": [ + "models.ParseTests_API_TestIpv6Policy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToServerTestLabelsModel", + "sdkType": "agent_to_server_tests.TestLabels", + "attrTypesVar": "testsAgentToServerTestLabelsAttrTypes", + "objectTypeVar": "testsAgentToServerTestLabelsObjectType", + "expandFunc": "expandTestsAgentToServerTestLabelses", + "flattenFunc": "flattenTestsAgentToServerTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]agent_to_server_tests.TestLabels", + "flatten": { + "func": "flattenTestsAgentToServerTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToServerTestBGPMonitorsModel", + "sdkType": "agent_to_server_tests.TestBgpMonitors", + "attrTypesVar": "testsAgentToServerTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsAgentToServerTestBGPMonitorsObjectType", + "expandFunc": "expandTestsAgentToServerTestBGPMonitorses", + "flattenFunc": "flattenTestsAgentToServerTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "agent_to_server_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]agent_to_server_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsAgentToServerTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nObserved: the API assigns 3 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "3" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "ping_payload_size", + "goField": "PingPayloadSize", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 1400 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests.", + "wire": { + "jsonPath": "pingPayloadSize", + "sdkField": "PingPayloadSize", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "port", + "goField": "Port", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Port number to use for the test. The default port is 80.", + "wire": { + "jsonPath": "port", + "sdkField": "Port", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "skipFlatten": true + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "server", + "goField": "Server", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The target name or IP address. If a port is set for the test, it is appended to the target name or IP address using a colon.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n\n\nThe API normalises this value (appends the port, www.example.com becomes www.example.com:80; the 2026-08-03 acceptance run (#13)); state carries the configured form.", + "behaviour": { + "requiredByApi": true, + "normalises": "appends the port, www.example.com becomes www.example.com:80" + }, + "wire": { + "jsonPath": "server", + "sdkField": "Server", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToServerTestSharedAccountsModel", + "sdkType": "agent_to_server_tests.TestSharedAccounts", + "attrTypesVar": "testsAgentToServerTestSharedAccountsAttrTypes", + "objectTypeVar": "testsAgentToServerTestSharedAccountsObjectType", + "expandFunc": "expandTestsAgentToServerTestSharedAccountses", + "flattenFunc": "flattenTestsAgentToServerTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]agent_to_server_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsAgentToServerTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAgentToServerTestTagsModel", + "sdkType": "agent_to_server_tests.TestTags", + "attrTypesVar": "testsAgentToServerTestTagsAttrTypes", + "objectTypeVar": "testsAgentToServerTestTagsObjectType", + "expandFunc": "expandTestsAgentToServerTestTagses", + "flattenFunc": "flattenTestsAgentToServerTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]agent_to_server_tests.TestTags", + "flatten": { + "func": "flattenTestsAgentToServerTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "AgentToServerAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "agentToServerAgentAttrTypes", + "objectTypeVar": "agentToServerAgentObjectType", + "expandFunc": "expandAgentToServerAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandAgentToServerAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get Agent to Server test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToServer" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_AgentToServerTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/agent-to-server" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_AgentToServerTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/agent-to-server/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "AgentToServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/agent-to-server/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_AgentToServerTestRequest", + "responseType": "models.Tests_API_AgentToServerTestResponseable", + "constructorExpr": "models.NewTests_API_AgentToServerTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "replaceOnly", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "server", + "hcl": "\"www.example.com\"" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_api.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_api.blueprint.json new file mode 100644 index 00000000..8e2910d6 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_api.blueprint.json @@ -0,0 +1,2802 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_api", + "name": "tests_api", + "goPackage": "tests_api", + "goPackageAlias": "v7TestsAPI", + "goTypeName": "TestsAPIResource", + "modelTypeName": "TestsAPIResourceModel", + "serviceGroup": "api_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAlertRuleModel", + "sdkType": "api_tests.AlertRule", + "attrTypesVar": "testsAPIAlertRuleAttrTypes", + "objectTypeVar": "testsAPIAlertRuleObjectType", + "expandFunc": "expandTestsAPIAlertRules", + "flattenFunc": "flattenTestsAPIAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "api_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "api_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "api_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "api_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "api_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "api_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "api_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "api_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]api_tests.AlertRule", + "expand": { + "func": "expandTestsAPIAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "client_cert_domains_allow_list", + "goField": "ClientCertDomainsAllowList", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Comma separated list of domains to send the client certificate.", + "behaviour": { + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "clientCertDomainsAllowList", + "sdkField": "ClientCertDomainsAllowList", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "client_certificate", + "goField": "ClientCertificate", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "clientCertificate", + "sdkField": "ClientCertificate", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "collect_proxy_network_data", + "goField": "CollectProxyNetworkData", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether network data to the proxy should be collected.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "collectProxyNetworkData", + "sdkField": "CollectProxyNetworkData", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "credentials", + "goField": "Credentials", + "type": { + "kind": "set", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).", + "wire": { + "jsonPath": "credentials", + "sdkField": "Credentials", + "sdkGoType": "[]string", + "expand": { + "func": "convert.FrameworkSetToStringSlice", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "convert.StringSliceToFrameworkSet", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "behaviour": { + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "distributed_tracing", + "goField": "DistributedTracing", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Adds distributed tracing headers to API requests using B3 and W3C standards.\n\n\nObserved: the API assigns false when this is omitted from an update.\nOmitting this field from an update resets it rather than preserving the stored value.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "updateDefault": { + "kind": "bool", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "distributedTracing", + "sdkField": "DistributedTracing", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "follow_redirects", + "goField": "FollowRedirects", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "followRedirects", + "sdkField": "FollowRedirects", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPITestLabelsModel", + "sdkType": "api_tests.TestLabels", + "attrTypesVar": "testsAPITestLabelsAttrTypes", + "objectTypeVar": "testsAPITestLabelsObjectType", + "expandFunc": "expandTestsAPITestLabelses", + "flattenFunc": "flattenTestsAPITestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.StringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]api_tests.TestLabels", + "flatten": { + "func": "flattenTestsAPITestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPITestBGPMonitorsModel", + "sdkType": "api_tests.TestBgpMonitors", + "attrTypesVar": "testsAPITestBGPMonitorsAttrTypes", + "objectTypeVar": "testsAPITestBGPMonitorsObjectType", + "expandFunc": "expandTestsAPITestBGPMonitorses", + "flattenFunc": "flattenTestsAPITestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "api_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]api_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsAPITestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nConditionally, when networkMeasurements is \"false\": round-trips alone, and is stored as null the moment \"networkMeasurements\" rides along; isolated by bisecting the maximal body's delta. Not applied to the schema, because this holds only under that condition and the schema has no way to say so.\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "3" + }, + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "override_agent_proxy", + "goField": "OverrideAgentProxy", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideAgentProxy", + "sdkField": "OverrideAgentProxy", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "override_proxy_id", + "goField": "OverrideProxyID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "ID of the proxy to be used if the default proxy is overridden.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideProxyId", + "sdkField": "OverrideProxyId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "predefined_variables", + "goField": "PredefinedVariables", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAPIPredefinedVariableModel", + "sdkType": "models.Tests_API_ApiPredefinedVariableable", + "attrTypesVar": "testsApiapiPredefinedVariableAttrTypes", + "objectTypeVar": "testsApiapiPredefinedVariableObjectType", + "expandFunc": "expandTestsAPIAPIPredefinedVariables", + "flattenFunc": "flattenTestsAPIAPIPredefinedVariables", + "attributes": [ + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Variable name. Must be unique.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Variable value, will be treated as string.", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_ApiPredefinedVariable()" + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "predefinedVariables", + "sdkField": "PredefinedVariables", + "sdkGoType": "[]models.Tests_API_ApiPredefinedVariableable", + "expand": { + "func": "expandTestsAPIAPIPredefinedVariables", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAPIPredefinedVariables", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "requests", + "goField": "Requests", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAPIRequestModel", + "sdkType": "models.Tests_API_ApiRequestable", + "attrTypesVar": "testsApiapiRequestAttrTypes", + "objectTypeVar": "testsApiapiRequestObjectType", + "expandFunc": "expandTestsAPIAPIRequests", + "flattenFunc": "flattenTestsAPIAPIRequests", + "attributes": [ + { + "name": "assertions", + "goField": "Assertions", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAPIRequestAssertionModel", + "sdkType": "models.Tests_API_ApiRequestAssertionable", + "attrTypesVar": "testsApiapiRequestAssertionAttrTypes", + "objectTypeVar": "testsApiapiRequestAssertionObjectType", + "expandFunc": "expandTestsAPIAPIRequestAssertions", + "flattenFunc": "flattenTestsAPIAPIRequestAssertions", + "attributes": [ + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string", + "allowedValues": [ + "status-code", + "response-body" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set to `status-code` to assert the response status code. Set to `response-body` to assert data is present in the response body. Use `ApiRequestAssertion` to set the value for the assertion.\n\n\nValues accepted here: `status-code`, `response-body`.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "acceptedValues": [ + "status-code", + "response-body" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*models.Tests_API_ApiRequestAssertionName", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_ApiRequestAssertionName" + ], + "extraArgs": [ + "models.ParseTests_API_ApiRequestAssertionName" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "operator", + "goField": "Operator", + "type": { + "kind": "string", + "allowedValues": [ + "is", + "is-not", + "includes", + "not-includes", + "matches", + "not-matches" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "If `name = status-code``, accepted values are [is, is-not]. If `name = response-body``, accepted values are [includes, not-includes, matches, not-matches]`.\n\n\nValues accepted here: `is`, `is-not`, `includes`, `not-includes`, `matches`, `not-matches`.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "acceptedValues": [ + "is", + "is-not", + "includes", + "not-includes", + "matches", + "not-matches" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "operator", + "sdkField": "Operator", + "sdkGoType": "*models.Tests_API_ApiRequestAssertionOperator", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_ApiRequestAssertionOperator" + ], + "extraArgs": [ + "models.ParseTests_API_ApiRequestAssertionOperator" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The value of the assertion. If name = `status-code`, the status code to assert. If name = `response-body`, the lookup value to assert.", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_ApiRequestAssertion()" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "List of assertion objects.", + "wire": { + "jsonPath": "assertions", + "sdkField": "Assertions", + "sdkGoType": "[]models.Tests_API_ApiRequestAssertionable", + "expand": { + "func": "expandTestsAPIAPIRequestAssertions", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAPIRequestAssertions", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "bearer-token", + "oauth2" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Will override the Authorization request header.\n\n\nValues accepted here: `none`, `basic`, `bearer-token`, `oauth2`.\nObserved: the API assigns \"none\" when this is omitted.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"none\"" + }, + "acceptedValues": [ + "none", + "basic", + "bearer-token", + "oauth2" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "*models.Tests_API_ApiRequestAuthType", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_ApiRequestAuthType" + ], + "extraArgs": [ + "models.ParseTests_API_ApiRequestAuthType" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "bearer_token", + "goField": "BearerToken", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The bearer token if `authType = bearer-token`.", + "wire": { + "jsonPath": "bearerToken", + "sdkField": "BearerToken", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "body", + "goField": "Body", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "POST/PUT request body. Must be in JSON format.", + "wire": { + "jsonPath": "body", + "sdkField": "Body", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "client_authentication", + "goField": "ClientAuthentication", + "type": { + "kind": "string", + "allowedValues": [ + "basic-auth-header", + "in-body" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The OAuth2 client authentication location type.\n\n\nValues accepted here: `basic-auth-header`, `in-body`.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "acceptedValues": [ + "basic-auth-header", + "in-body" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "clientAuthentication", + "sdkField": "ClientAuthentication", + "sdkGoType": "*models.Tests_API_ApiClientAuthentication", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_ApiClientAuthentication" + ], + "extraArgs": [ + "models.ParseTests_API_ApiClientAuthentication" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "client_id", + "goField": "ClientID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The application ID used when `authType` is set to \"oauth2\".", + "wire": { + "jsonPath": "clientId", + "sdkField": "ClientId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "client_secret", + "goField": "ClientSecret", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The private client secret used when `authType` is set to \"oauth2\".", + "wire": { + "jsonPath": "clientSecret", + "sdkField": "ClientSecret", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "collect_api_response", + "goField": "CollectAPIResponse", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` if API response body should be collected and saved. Set to `false` if API response body should not be saved.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + } + }, + "wire": { + "jsonPath": "collectApiResponse", + "sdkField": "CollectApiResponse", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "headers", + "goField": "Headers", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAPIRequestHeaderModel", + "sdkType": "models.Tests_API_ApiRequestHeaderable", + "attrTypesVar": "testsApiapiRequestHeaderAttrTypes", + "objectTypeVar": "testsApiapiRequestHeaderObjectType", + "expandFunc": "expandTestsAPIAPIRequestHeaders", + "flattenFunc": "flattenTestsAPIAPIRequestHeaders", + "attributes": [ + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Request header key.", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Request header value. Supports variables `{{variableName}}`.", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_ApiRequestHeader()" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Array of API Request Header objects.", + "wire": { + "jsonPath": "headers", + "sdkField": "Headers", + "sdkGoType": "[]models.Tests_API_ApiRequestHeaderable", + "expand": { + "func": "expandTestsAPIAPIRequestHeaders", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAPIRequestHeaders", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "method", + "goField": "Method", + "type": { + "kind": "string", + "allowedValues": [ + "get", + "post", + "put", + "delete", + "patch" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP request method.\n\n\nValues accepted here: `get`, `post`, `put`, `delete`, `patch`.\nObserved: the API assigns \"get\" when this is omitted.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"get\"" + }, + "acceptedValues": [ + "get", + "post", + "put", + "delete", + "patch" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "method", + "sdkField": "Method", + "sdkGoType": "*models.Tests_API_ApiRequestMethod", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_ApiRequestMethod" + ], + "extraArgs": [ + "models.ParseTests_API_ApiRequestMethod" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "API step name, must be unique.\n\n\nObserved: the API assigns \"step-1\" when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"step-1\"" + } + }, + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The password if `authType = basic`.", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "scope", + "goField": "Scope", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Application-specific scope values for the access token when `authType` is \"oauth2\".", + "wire": { + "jsonPath": "scope", + "sdkField": "Scope", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "token_url", + "goField": "TokenURL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The endpoint used to request the access token when `authType` is \"oauth2\".", + "wire": { + "jsonPath": "tokenUrl", + "sdkField": "TokenUrl", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "Request url. Supports variables in the format `{{variableName}}`.\n\n\nObserved: the API assigns \"https://api.stripe.com/healthcheck\" when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"https://api.stripe.com/healthcheck\"" + } + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The username if `authType = basic`.", + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "variables", + "goField": "Variables", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPIAPIRequestVariableModel", + "sdkType": "models.Tests_API_ApiRequestVariableable", + "attrTypesVar": "testsApiapiRequestVariableAttrTypes", + "objectTypeVar": "testsApiapiRequestVariableObjectType", + "expandFunc": "expandTestsAPIAPIRequestVariables", + "flattenFunc": "flattenTestsAPIAPIRequestVariables", + "attributes": [ + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Variable name", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The JSON path of data within the Response Body to assign to this variable.", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_ApiRequestVariable()" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Array of API post request variable objects.", + "wire": { + "jsonPath": "variables", + "sdkField": "Variables", + "sdkGoType": "[]models.Tests_API_ApiRequestVariableable", + "expand": { + "func": "expandTestsAPIAPIRequestVariables", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAPIRequestVariables", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "verify_certificate", + "goField": "VerifyCertificate", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + } + }, + "wire": { + "jsonPath": "verifyCertificate", + "sdkField": "VerifyCertificate", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "wait_time_ms", + "goField": "WaitTimeMs", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Post request delay before executing the next API requests, in milliseconds.", + "wire": { + "jsonPath": "waitTimeMs", + "sdkField": "WaitTimeMs", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + } + ], + "constructorExpr": "models.NewTests_API_ApiRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "requests", + "sdkField": "Requests", + "sdkGoType": "[]models.Tests_API_ApiRequestable", + "expand": { + "func": "expandTestsAPIAPIRequests", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPIAPIRequests", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPITestSharedAccountsModel", + "sdkType": "api_tests.TestSharedAccounts", + "attrTypesVar": "testsAPITestSharedAccountsAttrTypes", + "objectTypeVar": "testsAPITestSharedAccountsObjectType", + "expandFunc": "expandTestsAPITestSharedAccountses", + "flattenFunc": "flattenTestsAPITestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.StringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]api_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsAPITestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "ssl_version_id", + "goField": "SSLVersionID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "3", + "4", + "5", + "6", + "7" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "sslVersionId", + "sdkField": "SslVersionId", + "sdkGoType": "*models.Tests_API_TestSslVersionId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestSslVersionId" + ], + "extraArgs": [ + "models.ParseTests_API_TestSslVersionId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPITestTagsModel", + "sdkType": "api_tests.TestTags", + "attrTypesVar": "testsAPITestTagsAttrTypes", + "objectTypeVar": "testsAPITestTagsObjectType", + "expandFunc": "expandTestsAPITestTagses", + "flattenFunc": "flattenTestsAPITestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]api_tests.TestTags", + "flatten": { + "func": "flattenTestsAPITestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "target_time", + "goField": "TargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior)\n\n\nObserved: the API assigns 6 when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "6" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "targetTime", + "sdkField": "TargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "time_limit", + "goField": "TimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 180 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error.\n\n\nObserved: the API assigns 10 when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "10" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "timeLimit", + "sdkField": "TimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "Target for the test.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "vault_credentials", + "goField": "VaultCredentials", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsAPITestVaultCredentialModel", + "sdkType": "models.Tests_API_TestVaultCredentialable", + "attrTypesVar": "testsAPITestVaultCredentialAttrTypes", + "objectTypeVar": "testsAPITestVaultCredentialObjectType", + "expandFunc": "expandTestsAPITestVaultCredentials", + "flattenFunc": "flattenTestsAPITestVaultCredentials", + "attributes": [ + { + "name": "secret_id", + "goField": "SecretID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "UUID of the configured secret.", + "wire": { + "jsonPath": "secretId", + "sdkField": "SecretId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "target", + "goField": "Target", + "type": { + "kind": "string", + "allowedValues": [ + "username", + "password", + "script" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The target setting that the credential should be used for.\n\n\nValues accepted here: `username`, `password`, `script`.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "acceptedValues": [ + "username", + "password", + "script" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "target", + "sdkField": "Target", + "sdkGoType": "*models.Tests_API_TestVaultCredentialTarget", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestVaultCredentialTarget" + ], + "extraArgs": [ + "models.ParseTests_API_TestVaultCredentialTarget" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_TestVaultCredential()" + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "List of credential IDs that are stored in an external vault.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "vaultCredentials", + "sdkField": "VaultCredentials", + "sdkGoType": "[]models.Tests_API_TestVaultCredentialable", + "expand": { + "func": "expandTestsAPITestVaultCredentials", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsAPITestVaultCredentials", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "ApiAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "apiAgentAttrTypes", + "objectTypeVar": "apiAgentObjectType", + "expandFunc": "expandApiAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandApiAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get API test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Api" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_ApiTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/api" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Api" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_ApiTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/api/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Api" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_ApiTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/api/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Api" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/api/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_ApiTestRequest", + "responseType": "models.Tests_API_ApiTestResponseable", + "constructorExpr": "models.NewTests_API_ApiTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "requests", + "hcl": "[{ name = \"step-1\", url = \"https://api.stripe.com/healthcheck\", method = \"get\" }]" + }, + { + "attr": "url", + "hcl": "\"https://api.stripe.com/healthcheck\"" + }, + { + "attr": "interval", + "hcl": "3600" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_bgp.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_bgp.blueprint.json new file mode 100644 index 00000000..4d8ffd5d --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_bgp.blueprint.json @@ -0,0 +1,1194 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_bgp", + "name": "tests_bgp", + "goPackage": "tests_bgp", + "goPackageAlias": "v7TestsBGP", + "goTypeName": "TestsBGPResource", + "modelTypeName": "TestsBGPResourceModel", + "serviceGroup": "bgp_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsBGPAlertRuleModel", + "sdkType": "bgp_tests.AlertRule", + "attrTypesVar": "testsBGPAlertRuleAttrTypes", + "objectTypeVar": "testsBGPAlertRuleObjectType", + "expandFunc": "expandTestsBGPAlertRules", + "flattenFunc": "flattenTestsBGPAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "bgp_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "bgp_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "bgp_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "bgp_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "bgp_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "bgp_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "bgp_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "bgp_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]bgp_tests.AlertRule", + "expand": { + "func": "expandTestsBGPAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsBGPAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "include_covered_prefixes", + "goField": "IncludeCoveredPrefixes", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if queries for subprefixes detected under this prefix should included.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + } + }, + "wire": { + "jsonPath": "includeCoveredPrefixes", + "sdkField": "IncludeCoveredPrefixes", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsBGPTestLabelsModel", + "sdkType": "bgp_tests.TestLabels", + "attrTypesVar": "testsBGPTestLabelsAttrTypes", + "objectTypeVar": "testsBGPTestLabelsObjectType", + "expandFunc": "expandTestsBGPTestLabelses", + "flattenFunc": "flattenTestsBGPTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]bgp_tests.TestLabels", + "flatten": { + "func": "flattenTestsBGPTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsBGPTestBGPMonitorsModel", + "sdkType": "bgp_tests.TestBgpMonitors", + "attrTypesVar": "testsBGPTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsBGPTestBGPMonitorsObjectType", + "expandFunc": "expandTestsBGPTestBGPMonitorses", + "flattenFunc": "flattenTestsBGPTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "bgp_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]bgp_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsBGPTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "prefix", + "goField": "Prefix", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "prefix", + "sdkField": "Prefix", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsBGPTestSharedAccountsModel", + "sdkType": "bgp_tests.TestSharedAccounts", + "attrTypesVar": "testsBGPTestSharedAccountsAttrTypes", + "objectTypeVar": "testsBGPTestSharedAccountsObjectType", + "expandFunc": "expandTestsBGPTestSharedAccountses", + "flattenFunc": "flattenTestsBGPTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]bgp_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsBGPTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsBGPTestTagsModel", + "sdkType": "bgp_tests.TestTags", + "attrTypesVar": "testsBGPTestTagsAttrTypes", + "objectTypeVar": "testsBGPTestTagsObjectType", + "expandFunc": "expandTestsBGPTestTagses", + "flattenFunc": "flattenTestsBGPTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]bgp_tests.TestTags", + "flatten": { + "func": "flattenTestsBGPTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + } + ], + "markdownDescription": "Get BGP test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Bgp" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_BgpTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/bgp" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Bgp" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_BgpTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/bgp/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Bgp" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/bgp/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_BgpTestRequest", + "responseType": "models.Tests_API_BgpTestResponseable", + "constructorExpr": "models.NewTests_API_BgpTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "replaceOnly", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "prefix", + "hcl": "\"8.8.8.0/24\"" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_dns_server.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_dns_server.blueprint.json new file mode 100644 index 00000000..0e6e73f4 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_dns_server.blueprint.json @@ -0,0 +1,1775 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_dns_server", + "name": "tests_dns_server", + "goPackage": "tests_dns_server", + "goPackageAlias": "v7TestsDNSServer", + "goTypeName": "TestsDNSServerResource", + "modelTypeName": "TestsDNSServerResourceModel", + "serviceGroup": "dns_server_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSServerAlertRuleModel", + "sdkType": "dns_server_tests.AlertRule", + "attrTypesVar": "testsDNSServerAlertRuleAttrTypes", + "objectTypeVar": "testsDNSServerAlertRuleObjectType", + "expandFunc": "expandTestsDNSServerAlertRules", + "flattenFunc": "flattenTestsDNSServerAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "dns_server_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_server_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "dns_server_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_server_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "dns_server_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "dns_server_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "dns_server_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_server_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]dns_server_tests.AlertRule", + "expand": { + "func": "expandTestsDNSServerAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsDNSServerAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\n\nObserved: the API assigns false when this is omitted.\n\n\nSDK limitation: the wire field is a value-typed bool with omitempty, so an explicit `false` cannot be sent; with `network_measurements = true` the API then treats bandwidth measurement as requested, which cloud agents refuse.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "dns_query_class", + "goField": "DNSQueryClass", + "type": { + "kind": "string", + "allowedValues": [ + "in", + "ch" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dnsQueryClass", + "sdkField": "DnsQueryClass", + "sdkGoType": "*models.Tests_API_DnsQueryClass", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_DnsQueryClass" + ], + "extraArgs": [ + "models.ParseTests_API_DnsQueryClass" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "dns_servers", + "goField": "DNSServers", + "type": { + "kind": "set", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "A list of DNS server FQDN.\n\nSent as a list of server names; the read reports servers as objects, which v1 does not round-trip.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "dnsServers", + "sdkField": "DnsServers", + "sdkGoType": "[]string", + "expand": { + "func": "convert.FrameworkSetToStringSlice", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + }, + { + "name": "dns_transport_protocol", + "goField": "DNSTransportProtocol", + "type": { + "kind": "string", + "allowedValues": [ + "udp", + "tcp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Transport protocol used for DNS requests.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dnsTransportProtocol", + "sdkField": "DnsTransportProtocol", + "sdkGoType": "*models.Tests_API_TestDnsTransportProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDnsTransportProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestDnsTransportProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "domain", + "goField": "Domain", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n\n\nThe API normalises this value (appends the record type, example.com becomes \"example.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured form.", + "behaviour": { + "requiredByApi": true, + "normalises": "appends the record type, example.com becomes \"example.com ANY\"" + }, + "wire": { + "jsonPath": "domain", + "sdkField": "Domain", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ipv6_policy", + "goField": "Ipv6Policy", + "type": { + "kind": "string", + "allowedValues": [ + "force-ipv4", + "prefer-ipv6", + "force-ipv6", + "use-agent-policy" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "IP version policy. Overrides the IPv6 policy configured at the agent level.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "ipv6Policy", + "sdkField": "Ipv6Policy", + "sdkGoType": "*models.Tests_API_TestIpv6Policy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestIpv6Policy" + ], + "extraArgs": [ + "models.ParseTests_API_TestIpv6Policy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSServerTestLabelsModel", + "sdkType": "dns_server_tests.TestLabels", + "attrTypesVar": "testsDNSServerTestLabelsAttrTypes", + "objectTypeVar": "testsDNSServerTestLabelsObjectType", + "expandFunc": "expandTestsDNSServerTestLabelses", + "flattenFunc": "flattenTestsDNSServerTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]dns_server_tests.TestLabels", + "flatten": { + "func": "flattenTestsDNSServerTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSServerTestBGPMonitorsModel", + "sdkType": "dns_server_tests.TestBgpMonitors", + "attrTypesVar": "testsDNSServerTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsDNSServerTestBGPMonitorsObjectType", + "expandFunc": "expandTestsDNSServerTestBGPMonitorses", + "flattenFunc": "flattenTestsDNSServerTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "dns_server_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]dns_server_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsDNSServerTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\nComputed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions.", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nObserved: the API assigns 1 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "1" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "immutable": false, + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "recursive_queries", + "goField": "RecursiveQueries", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set true to run query with RD (recursion desired) flag enabled.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + } + }, + "wire": { + "jsonPath": "recursiveQueries", + "sdkField": "RecursiveQueries", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSServerTestSharedAccountsModel", + "sdkType": "dns_server_tests.TestSharedAccounts", + "attrTypesVar": "testsDNSServerTestSharedAccountsAttrTypes", + "objectTypeVar": "testsDNSServerTestSharedAccountsObjectType", + "expandFunc": "expandTestsDNSServerTestSharedAccountses", + "flattenFunc": "flattenTestsDNSServerTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]dns_server_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsDNSServerTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSServerTestTagsModel", + "sdkType": "dns_server_tests.TestTags", + "attrTypesVar": "testsDNSServerTestTagsAttrTypes", + "objectTypeVar": "testsDNSServerTestTagsObjectType", + "expandFunc": "expandTestsDNSServerTestTagses", + "flattenFunc": "flattenTestsDNSServerTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]dns_server_tests.TestTags", + "flatten": { + "func": "flattenTestsDNSServerTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "DnsServerAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "dnsServerAgentAttrTypes", + "objectTypeVar": "dnsServerAgentObjectType", + "expandFunc": "expandDnsServerAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandDnsServerAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get DNS Server test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsServer" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsServerTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/dns-server" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsServerTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/dns-server/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsServerTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/dns-server/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/dns-server/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_DnsServerTestRequest", + "responseType": "models.Tests_API_DnsServerTestResponseable", + "constructorExpr": "models.NewTests_API_DnsServerTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "domain", + "hcl": "\"example.com\"" + }, + { + "attr": "dns_servers", + "hcl": "[\"8.8.8.8\"]" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_dns_trace.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_dns_trace.blueprint.json new file mode 100644 index 00000000..225e529a --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_dns_trace.blueprint.json @@ -0,0 +1,1237 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_dns_trace", + "name": "tests_dns_trace", + "goPackage": "tests_dns_trace", + "goPackageAlias": "v7TestsDNSTrace", + "goTypeName": "TestsDNSTraceResource", + "modelTypeName": "TestsDNSTraceResourceModel", + "serviceGroup": "dns_trace_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSTraceAlertRuleModel", + "sdkType": "dns_trace_tests.AlertRule", + "attrTypesVar": "testsDNSTraceAlertRuleAttrTypes", + "objectTypeVar": "testsDNSTraceAlertRuleObjectType", + "expandFunc": "expandTestsDNSTraceAlertRules", + "flattenFunc": "flattenTestsDNSTraceAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "dns_trace_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_trace_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "dns_trace_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_trace_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "dns_trace_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "dns_trace_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "dns_trace_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dns_trace_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]dns_trace_tests.AlertRule", + "expand": { + "func": "expandTestsDNSTraceAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsDNSTraceAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnRead": true + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "behaviour": { + "returnedOnRead": true + }, + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "dns_query_class", + "goField": "DNSQueryClass", + "type": { + "kind": "string", + "allowedValues": [ + "in", + "ch" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dnsQueryClass", + "sdkField": "DnsQueryClass", + "sdkGoType": "*models.Tests_API_DnsQueryClass", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_DnsQueryClass" + ], + "extraArgs": [ + "models.ParseTests_API_DnsQueryClass" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "dns_transport_protocol", + "goField": "DNSTransportProtocol", + "type": { + "kind": "string", + "allowedValues": [ + "udp", + "tcp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Transport protocol used for DNS requests.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dnsTransportProtocol", + "sdkField": "DnsTransportProtocol", + "sdkGoType": "*models.Tests_API_TestDnsTransportProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDnsTransportProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestDnsTransportProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "domain", + "goField": "Domain", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n\n\nThe API normalises this value (appends the record type, example.com becomes \"example.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured form.", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": true, + "normalises": "appends the record type, example.com becomes \"example.com ANY\"" + }, + "wire": { + "jsonPath": "domain", + "sdkField": "Domain", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnRead": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSTraceTestLabelsModel", + "sdkType": "dns_trace_tests.TestLabels", + "attrTypesVar": "testsDNSTraceTestLabelsAttrTypes", + "objectTypeVar": "testsDNSTraceTestLabelsObjectType", + "expandFunc": "expandTestsDNSTraceTestLabelses", + "flattenFunc": "flattenTestsDNSTraceTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]dns_trace_tests.TestLabels", + "flatten": { + "func": "flattenTestsDNSTraceTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnRead": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSTraceTestSharedAccountsModel", + "sdkType": "dns_trace_tests.TestSharedAccounts", + "attrTypesVar": "testsDNSTraceTestSharedAccountsAttrTypes", + "objectTypeVar": "testsDNSTraceTestSharedAccountsObjectType", + "expandFunc": "expandTestsDNSTraceTestSharedAccountses", + "flattenFunc": "flattenTestsDNSTraceTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]dns_trace_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsDNSTraceTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSTraceTestTagsModel", + "sdkType": "dns_trace_tests.TestTags", + "attrTypesVar": "testsDNSTraceTestTagsAttrTypes", + "objectTypeVar": "testsDNSTraceTestTagsObjectType", + "expandFunc": "expandTestsDNSTraceTestTagses", + "flattenFunc": "flattenTestsDNSTraceTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]dns_trace_tests.TestTags", + "flatten": { + "func": "flattenTestsDNSTraceTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "behaviour": { + "returnedOnRead": true + }, + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "DnsTraceAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "dnsTraceAgentAttrTypes", + "objectTypeVar": "dnsTraceAgentObjectType", + "expandFunc": "expandDnsTraceAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandDnsTraceAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get DNS Trace test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsTrace" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsTraceTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/dns-trace" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsTrace" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsTraceTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/dns-trace/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsTrace" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsTraceTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/dns-trace/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "DnsTrace" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/dns-trace/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_DnsTraceTestRequest", + "responseType": "models.Tests_API_DnsTraceTestResponseable", + "constructorExpr": "models.NewTests_API_DnsTraceTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "domain", + "hcl": "\"example.com\"" + }, + { + "attr": "interval", + "hcl": "3600" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_dnssec.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_dnssec.blueprint.json new file mode 100644 index 00000000..7bccc346 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_dnssec.blueprint.json @@ -0,0 +1,1203 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_dnssec", + "name": "tests_dnssec", + "goPackage": "tests_dnssec", + "goPackageAlias": "v7TestsDNSSEC", + "goTypeName": "TestsDNSSECResource", + "modelTypeName": "TestsDNSSECResourceModel", + "serviceGroup": "dnssec_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSSECAlertRuleModel", + "sdkType": "dnssec_tests.AlertRule", + "attrTypesVar": "testsDnssecAlertRuleAttrTypes", + "objectTypeVar": "testsDnssecAlertRuleObjectType", + "expandFunc": "expandTestsDNSSECAlertRules", + "flattenFunc": "flattenTestsDNSSECAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "dnssec_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dnssec_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "dnssec_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dnssec_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "dnssec_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "dnssec_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "dnssec_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "dnssec_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]dnssec_tests.AlertRule", + "expand": { + "func": "expandTestsDNSSECAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsDNSSECAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnRead": true + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "behaviour": { + "returnedOnRead": true + }, + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "dns_query_class", + "goField": "DNSQueryClass", + "type": { + "kind": "string", + "allowedValues": [ + "in", + "ch" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dnsQueryClass", + "sdkField": "DnsQueryClass", + "sdkGoType": "*models.Tests_API_DnsQueryClass", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_DnsQueryClass" + ], + "extraArgs": [ + "models.ParseTests_API_DnsQueryClass" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "domain", + "goField": "Domain", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n\n\nThe API normalises this value (appends the record type, cloudflare.com becomes \"cloudflare.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured form.", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": true, + "normalises": "appends the record type, cloudflare.com becomes \"cloudflare.com ANY\"" + }, + "wire": { + "jsonPath": "domain", + "sdkField": "Domain", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnRead": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSSECTestLabelsModel", + "sdkType": "dnssec_tests.TestLabels", + "attrTypesVar": "testsDnssecTestLabelsAttrTypes", + "objectTypeVar": "testsDnssecTestLabelsObjectType", + "expandFunc": "expandTestsDNSSECTestLabelses", + "flattenFunc": "flattenTestsDNSSECTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]dnssec_tests.TestLabels", + "flatten": { + "func": "flattenTestsDNSSECTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnRead": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSSECTestSharedAccountsModel", + "sdkType": "dnssec_tests.TestSharedAccounts", + "attrTypesVar": "testsDnssecTestSharedAccountsAttrTypes", + "objectTypeVar": "testsDnssecTestSharedAccountsObjectType", + "expandFunc": "expandTestsDNSSECTestSharedAccountses", + "flattenFunc": "flattenTestsDNSSECTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]dnssec_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsDNSSECTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsDNSSECTestTagsModel", + "sdkType": "dnssec_tests.TestTags", + "attrTypesVar": "testsDnssecTestTagsAttrTypes", + "objectTypeVar": "testsDnssecTestTagsObjectType", + "expandFunc": "expandTestsDNSSECTestTagses", + "flattenFunc": "flattenTestsDNSSECTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]dnssec_tests.TestTags", + "flatten": { + "func": "flattenTestsDNSSECTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "behaviour": { + "returnedOnRead": true + }, + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "DnssecAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "dnssecAgentAttrTypes", + "objectTypeVar": "dnssecAgentObjectType", + "expandFunc": "expandDnssecAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandDnssecAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get DNSSEC test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Dnssec" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsSecTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/dnssec" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Dnssec" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsSecTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/dnssec/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Dnssec" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_DnsSecTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/dnssec/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Dnssec" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/dnssec/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_DnsSecTestRequest", + "responseType": "models.Tests_API_DnsSecTestResponseable", + "constructorExpr": "models.NewTests_API_DnsSecTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "domain", + "hcl": "\"cloudflare.com\"" + }, + { + "attr": "interval", + "hcl": "3600" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_ftp_server.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_ftp_server.blueprint.json new file mode 100644 index 00000000..f27762e6 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_ftp_server.blueprint.json @@ -0,0 +1,1931 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_ftp_server", + "name": "tests_ftp_server", + "goPackage": "tests_ftp_server", + "goPackageAlias": "v7TestsFTPServer", + "goTypeName": "TestsFTPServerResource", + "modelTypeName": "TestsFTPServerResourceModel", + "serviceGroup": "ftp_server_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsFTPServerAlertRuleModel", + "sdkType": "ftp_server_tests.AlertRule", + "attrTypesVar": "testsFTPServerAlertRuleAttrTypes", + "objectTypeVar": "testsFTPServerAlertRuleObjectType", + "expandFunc": "expandTestsFTPServerAlertRules", + "flattenFunc": "flattenTestsFTPServerAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "ftp_server_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "ftp_server_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "ftp_server_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "ftp_server_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "ftp_server_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "ftp_server_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "ftp_server_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "ftp_server_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]ftp_server_tests.AlertRule", + "expand": { + "func": "expandTestsFTPServerAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsFTPServerAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "download_limit", + "goField": "DownloadLimit", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specify maximum number of bytes to download from the target object.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "downloadLimit", + "sdkField": "DownloadLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ftp_target_time", + "goField": "FTPTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1000, + "maximum": 6000 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for operation completion; specified in milliseconds.\n\n\nObserved: the API assigns 1000 when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "1000" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "ftpTargetTime", + "sdkField": "FtpTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ftp_time_limit", + "goField": "FTPTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 10, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set the time limit for the test in seconds.\n\n\nObserved: the API assigns 5 when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "5" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "ftpTimeLimit", + "sdkField": "FtpTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ipv6_policy", + "goField": "Ipv6Policy", + "type": { + "kind": "string", + "allowedValues": [ + "force-ipv4", + "prefer-ipv6", + "force-ipv6", + "use-agent-policy" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "IP version policy. Overrides the IPv6 policy configured at the agent level.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "ipv6Policy", + "sdkField": "Ipv6Policy", + "sdkGoType": "*models.Tests_API_TestIpv6Policy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestIpv6Policy" + ], + "extraArgs": [ + "models.ParseTests_API_TestIpv6Policy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsFTPServerTestLabelsModel", + "sdkType": "ftp_server_tests.TestLabels", + "attrTypesVar": "testsFTPServerTestLabelsAttrTypes", + "objectTypeVar": "testsFTPServerTestLabelsObjectType", + "expandFunc": "expandTestsFTPServerTestLabelses", + "flattenFunc": "flattenTestsFTPServerTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]ftp_server_tests.TestLabels", + "flatten": { + "func": "flattenTestsFTPServerTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsFTPServerTestBGPMonitorsModel", + "sdkType": "ftp_server_tests.TestBgpMonitors", + "attrTypesVar": "testsFTPServerTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsFTPServerTestBGPMonitorsObjectType", + "expandFunc": "expandTestsFTPServerTestBGPMonitorses", + "flattenFunc": "flattenTestsFTPServerTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "ftp_server_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]ftp_server_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsFTPServerTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\nComputed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions.", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nObserved: the API assigns 3 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "3" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "sensitive": true, + "markdownDescription": "Password for Basic/NTLM authentication.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n\n\nWrite-only: the API never returns it (the 2026-08-03 acceptance run (#13)); state carries the configured value.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "immutable": false, + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "request_type", + "goField": "RequestType", + "type": { + "kind": "string", + "allowedValues": [ + "download", + "upload", + "list" + ] + }, + "computedOptionalRequired": "required", + "markdownDescription": "Set the type of activity for the test.\n\n\nValues accepted here: `download`, `list`.\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true, + "acceptedValues": [ + "download", + "list" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "requestType", + "sdkField": "RequestType", + "sdkGoType": "*models.Tests_API_FtpServerRequestType", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_FtpServerRequestType" + ], + "extraArgs": [ + "models.ParseTests_API_FtpServerRequestType" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsFTPServerTestSharedAccountsModel", + "sdkType": "ftp_server_tests.TestSharedAccounts", + "attrTypesVar": "testsFTPServerTestSharedAccountsAttrTypes", + "objectTypeVar": "testsFTPServerTestSharedAccountsObjectType", + "expandFunc": "expandTestsFTPServerTestSharedAccountses", + "flattenFunc": "flattenTestsFTPServerTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]ftp_server_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsFTPServerTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsFTPServerTestTagsModel", + "sdkType": "ftp_server_tests.TestTags", + "attrTypesVar": "testsFTPServerTestTagsAttrTypes", + "objectTypeVar": "testsFTPServerTestTagsObjectType", + "expandFunc": "expandTestsFTPServerTestTagses", + "flattenFunc": "flattenTestsFTPServerTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]ftp_server_tests.TestTags", + "flatten": { + "func": "flattenTestsFTPServerTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string", + "allowedValues": [ + "api", + "agent-to-agent", + "agent-to-server", + "bgp", + "http-server", + "page-load", + "web-transactions", + "ftp-server", + "dns-trace", + "dns-server", + "dnssec", + "sip-server", + "voice" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "Target for the test.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n\n\nThe API normalises this value (appends a trailing slash; the 2026-08-03 acceptance run (#13)); state carries the configured form.", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true, + "normalises": "appends a trailing slash" + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "use_active_ftp", + "goField": "UseActiveFTP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Explicitly set the flag to use active FTP.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "useActiveFtp", + "sdkField": "UseActiveFtp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "use_explicit_ftps", + "goField": "UseExplicitFTPs", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS.\n\n\nObserved: the API assigns false when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "useExplicitFtps", + "sdkField": "UseExplicitFtps", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "Username for Basic/NTLM authentication.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "FtpServerAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "ftpServerAgentAttrTypes", + "objectTypeVar": "ftpServerAgentObjectType", + "expandFunc": "expandFtpServerAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandFtpServerAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get FTP Server test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "FtpServer" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_FtpServerTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/ftp-server" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "FtpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_FtpServerTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/ftp-server/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "FtpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_FtpServerTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/ftp-server/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "FtpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/ftp-server/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_FtpServerTestRequest", + "responseType": "models.Tests_API_FtpServerTestResponseable", + "constructorExpr": "models.NewTests_API_FtpServerTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "url", + "hcl": "\"ftp://speedtest.tele2.net\"" + }, + { + "attr": "username", + "hcl": "\"anonymous\"" + }, + { + "attr": "password", + "hcl": "\"guest\"" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + }, + { + "attr": "ftp_time_limit", + "hcl": "30" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_http_server.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_http_server.blueprint.json new file mode 100644 index 00000000..ec5e27d2 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_http_server.blueprint.json @@ -0,0 +1,2866 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_http_server", + "name": "tests_http_server", + "goPackage": "tests_http_server", + "goPackageAlias": "v7TestsHTTPServer", + "goTypeName": "TestsHTTPServerResource", + "modelTypeName": "TestsHTTPServerResourceModel", + "serviceGroup": "http_server_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "agent_interfaces", + "goField": "AgentInterfaces", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerAgentInterfacesModel", + "sdkType": "http_server_tests.AgentInterfaces", + "attrTypesVar": "testsHTTPServerAgentInterfacesAttrTypes", + "objectTypeVar": "testsHTTPServerAgentInterfacesObjectType", + "expandFunc": "expandTestsHTTPServerAgentInterfaces", + "flattenFunc": "flattenTestsHTTPServerAgentInterfaces", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The agent ID of the enterprise agent for the test.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentID", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address of the agent interface.", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "agentInterfaces", + "sdkField": "AgentInterfaces", + "sdkGoType": "*http_server_tests.AgentInterfaces", + "expand": { + "func": "expandTestsHTTPServerAgentInterfaces", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsHTTPServerAgentInterfaces", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerAlertRuleModel", + "sdkType": "http_server_tests.AlertRule", + "attrTypesVar": "testsHTTPServerAlertRuleAttrTypes", + "objectTypeVar": "testsHTTPServerAlertRuleObjectType", + "expandFunc": "expandTestsHTTPServerAlertRules", + "flattenFunc": "flattenTestsHTTPServerAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "http_server_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "http_server_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "http_server_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "http_server_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "http_server_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]http_server_tests.AlertRule", + "expand": { + "func": "expandTestsHTTPServerAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsHTTPServerAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_unsafe_legacy_renegotiation", + "goField": "AllowUnsafeLegacyRenegotiation", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowUnsafeLegacyRenegotiation", + "sdkField": "AllowUnsafeLegacyRenegotiation", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm", + "kerberos", + "oauth" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP authentication type.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "*models.Tests_API_TestAuthType", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestAuthType" + ], + "extraArgs": [ + "models.ParseTests_API_TestAuthType" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "client_certificate", + "goField": "ClientCertificate", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "clientCertificate", + "sdkField": "ClientCertificate", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "collect_proxy_network_data", + "goField": "CollectProxyNetworkData", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether network data to the proxy should be collected.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "collectProxyNetworkData", + "sdkField": "CollectProxyNetworkData", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "content_regex", + "goField": "ContentRegex", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Content regex, this field does not require escaping.\n\n\nObserved: the API assigns \"\" when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"\"" + }, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "contentRegex", + "sdkField": "ContentRegex", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "custom_headers", + "goField": "CustomHeaders", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestCustomHeadersModel", + "sdkType": "http_server_tests.TestCustomHeaders", + "attrTypesVar": "testsHTTPServerTestCustomHeadersAttrTypes", + "objectTypeVar": "testsHTTPServerTestCustomHeadersObjectType", + "expandFunc": "expandTestsHTTPServerTestCustomHeaders", + "flattenFunc": "flattenTestsHTTPServerTestCustomHeaders", + "attributes": [ + { + "name": "all", + "goField": "All", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for all domains.", + "wire": { + "jsonPath": "all", + "sdkField": "All", + "sdkGoType": "any" + } + }, + { + "name": "domains", + "goField": "Domains", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for the specified domains.", + "wire": { + "jsonPath": "domains", + "sdkField": "Domains", + "sdkGoType": "any" + } + }, + { + "name": "root", + "goField": "Root", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for root server request.", + "wire": { + "jsonPath": "root", + "sdkField": "Root", + "sdkGoType": "any" + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "customHeaders", + "sdkField": "CustomHeaders", + "sdkGoType": "*http_server_tests.TestCustomHeaders", + "expand": { + "func": "expandTestsHTTPServerTestCustomHeaders", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsHTTPServerTestCustomHeaders", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "desired_status_code", + "goField": "DesiredStatusCode", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "desiredStatusCode", + "sdkField": "DesiredStatusCode", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "distributed_tracing", + "goField": "DistributedTracing", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Adds distributed tracing headers to API requests using B3 and W3C standards.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "distributedTracing", + "sdkField": "DistributedTracing", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "dns_override", + "goField": "DNSOverride", + "type": { + "kind": "string", + "constraints": { + "format": "ipv4" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address to use for DNS override.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "dnsOverride", + "sdkField": "DnsOverride", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "download_limit", + "goField": "DownloadLimit", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specifies maximum number of bytes to download from the target object.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "downloadLimit", + "sdkField": "DownloadLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "follow_redirects", + "goField": "FollowRedirects", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "followRedirects", + "sdkField": "FollowRedirects", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "headers", + "goField": "Headers", + "type": { + "kind": "set", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP request headers used.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "headers", + "sdkField": "Headers", + "sdkGoType": "[]string", + "expand": { + "func": "convert.FrameworkSetToStringSlice", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "convert.StringSliceToFrameworkSet", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "http_target_time", + "goField": "HTTPTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 100, + "maximum": 5000 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for HTTP server completion, specified in milliseconds.\n\n\nObserved: the API assigns 1000 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "1000" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTargetTime", + "sdkField": "HttpTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_time_limit", + "goField": "HTTPTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP time limit in seconds.\n\n\nObserved: the API assigns 5 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "5" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTimeLimit", + "sdkField": "HttpTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_version", + "goField": "HTTPVersion", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 2 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.\n\n\nObserved: the API assigns 2 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "2" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpVersion", + "sdkField": "HttpVersion", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "include_headers", + "goField": "IncludeHeaders", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to capture response headers for objects loaded by the test.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "includeHeaders", + "sdkField": "IncludeHeaders", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ipv6_policy", + "goField": "Ipv6Policy", + "type": { + "kind": "string", + "allowedValues": [ + "force-ipv4", + "prefer-ipv6", + "force-ipv6", + "use-agent-policy" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "IP version policy. Overrides the IPv6 policy configured at the agent level.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "ipv6Policy", + "sdkField": "Ipv6Policy", + "sdkGoType": "*models.Tests_API_TestIpv6Policy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestIpv6Policy" + ], + "extraArgs": [ + "models.ParseTests_API_TestIpv6Policy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestLabelsModel", + "sdkType": "http_server_tests.TestLabels", + "attrTypesVar": "testsHTTPServerTestLabelsAttrTypes", + "objectTypeVar": "testsHTTPServerTestLabelsObjectType", + "expandFunc": "expandTestsHTTPServerTestLabelses", + "flattenFunc": "flattenTestsHTTPServerTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]http_server_tests.TestLabels", + "flatten": { + "func": "flattenTestsHTTPServerTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestBGPMonitorsModel", + "sdkType": "http_server_tests.TestBgpMonitors", + "attrTypesVar": "testsHTTPServerTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsHTTPServerTestBGPMonitorsObjectType", + "expandFunc": "expandTestsHTTPServerTestBGPMonitorses", + "flattenFunc": "flattenTestsHTTPServerTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "http_server_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]http_server_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsHTTPServerTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\nComputed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions.", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nObserved: the API assigns 3 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "3" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "o_auth", + "goField": "OAuth", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerOAuthModel", + "sdkType": "http_server_tests.OAuth", + "attrTypesVar": "testsHTTPServerOAuthAttrTypes", + "objectTypeVar": "testsHTTPServerOAuthObjectType", + "expandFunc": "expandTestsHTTPServerOAuth", + "flattenFunc": "flattenTestsHTTPServerOAuth", + "attributes": [ + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP authentication type used for the OAuth request.", + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "http_server_tests.OAuthAuthType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.OAuthAuthType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "headers", + "goField": "Headers", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Request headers used for OAuth.", + "wire": { + "jsonPath": "headers", + "sdkField": "Headers", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth password", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "post_body", + "goField": "PostBody", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enter the OAuth body for the HTTP POST request in this field when using OAuth as the authentication mechanism. No special escaping is required. The value is saved only when `requestMethod` is set to `post`.", + "wire": { + "jsonPath": "postBody", + "sdkField": "PostBody", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "request_method", + "goField": "RequestMethod", + "type": { + "kind": "string", + "allowedValues": [ + "get", + "post" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP request method.", + "wire": { + "jsonPath": "requestMethod", + "sdkField": "RequestMethod", + "sdkGoType": "http_server_tests.RequestMethod", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.RequestMethod" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "test_url", + "goField": "TestURL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.", + "wire": { + "jsonPath": "testUrl", + "sdkField": "TestURL", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "http_server_tests.TestUrl" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth username", + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use this only if you want to use OAuth as the authentication mechanism.", + "wire": { + "jsonPath": "oAuth", + "sdkField": "OAuth", + "sdkGoType": "*http_server_tests.OAuth", + "expand": { + "func": "expandTestsHTTPServerOAuth", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsHTTPServerOAuth", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "override_agent_proxy", + "goField": "OverrideAgentProxy", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideAgentProxy", + "sdkField": "OverrideAgentProxy", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "override_proxy_id", + "goField": "OverrideProxyID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "ID of the proxy to be used if the default proxy is overridden.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideProxyId", + "sdkField": "OverrideProxyId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Password for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "post_body", + "goField": "PostBody", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enter the body for the HTTP POST request in this field. No special escaping is required. If content is provided and `requestMethod` is not specified, `requestMethod` is automatically set to `post`.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "postBody", + "sdkField": "PostBody", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "immutable": false, + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "request_method", + "goField": "RequestMethod", + "type": { + "kind": "string", + "allowedValues": [ + "get", + "post" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP request method.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "requestMethod", + "sdkField": "RequestMethod", + "sdkGoType": "*models.Tests_API_RequestMethod", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_RequestMethod" + ], + "extraArgs": [ + "models.ParseTests_API_RequestMethod" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestSharedAccountsModel", + "sdkType": "http_server_tests.TestSharedAccounts", + "attrTypesVar": "testsHTTPServerTestSharedAccountsAttrTypes", + "objectTypeVar": "testsHTTPServerTestSharedAccountsObjectType", + "expandFunc": "expandTestsHTTPServerTestSharedAccountses", + "flattenFunc": "flattenTestsHTTPServerTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]http_server_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsHTTPServerTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "ssl_version", + "goField": "SSLVersion", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Reflects the verbose SSL protocol version used by a test.", + "wire": { + "jsonPath": "sslVersion", + "sdkField": "SslVersion", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ssl_version_id", + "goField": "SSLVersionID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "3", + "4", + "5", + "6", + "7" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "sslVersionId", + "sdkField": "SslVersionId", + "sdkGoType": "*models.Tests_API_TestSslVersionId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestSslVersionId" + ], + "extraArgs": [ + "models.ParseTests_API_TestSslVersionId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestTagsModel", + "sdkType": "http_server_tests.TestTags", + "attrTypesVar": "testsHTTPServerTestTagsAttrTypes", + "objectTypeVar": "testsHTTPServerTestTagsObjectType", + "expandFunc": "expandTestsHTTPServerTestTagses", + "flattenFunc": "flattenTestsHTTPServerTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]http_server_tests.TestTags", + "flatten": { + "func": "flattenTestsHTTPServerTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string", + "allowedValues": [ + "api", + "agent-to-agent", + "agent-to-server", + "bgp", + "http-server", + "page-load", + "web-transactions", + "ftp-server", + "dns-trace", + "dns-server", + "dnssec", + "sip-server", + "voice" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnUpdate": true + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "use_ntlm", + "goField": "UseNtlm", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "useNtlm", + "sdkField": "UseNtlm", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "user_agent", + "goField": "UserAgent", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "User-agent string to be provided during the test.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "returnedOnRead": false, + "returnedOnUpdate": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "userAgent", + "sdkField": "UserAgent", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Username for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "vault_credentials", + "goField": "VaultCredentials", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsHTTPServerTestVaultCredentialModel", + "sdkType": "models.Tests_API_TestVaultCredentialable", + "attrTypesVar": "testsHTTPServerTestVaultCredentialAttrTypes", + "objectTypeVar": "testsHTTPServerTestVaultCredentialObjectType", + "expandFunc": "expandTestsHTTPServerTestVaultCredentials", + "flattenFunc": "flattenTestsHTTPServerTestVaultCredentials", + "attributes": [ + { + "name": "secret_id", + "goField": "SecretID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "UUID of the configured secret.", + "wire": { + "jsonPath": "secretId", + "sdkField": "SecretId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "target", + "goField": "Target", + "type": { + "kind": "string", + "allowedValues": [ + "username", + "password", + "script" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The target setting that the credential should be used for.", + "wire": { + "jsonPath": "target", + "sdkField": "Target", + "sdkGoType": "*models.Tests_API_TestVaultCredentialTarget", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestVaultCredentialTarget" + ], + "extraArgs": [ + "models.ParseTests_API_TestVaultCredentialTarget" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_TestVaultCredential()" + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "List of credential IDs that are stored in an external vault.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "vaultCredentials", + "sdkField": "VaultCredentials", + "sdkGoType": "[]models.Tests_API_TestVaultCredentialable", + "expand": { + "func": "expandTestsHTTPServerTestVaultCredentials", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsHTTPServerTestVaultCredentials", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "verify_certificate", + "goField": "VerifyCertificate", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "returnedOnUpdate": true, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "verifyCertificate", + "sdkField": "VerifyCertificate", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "HttpServerAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "httpServerAgentAttrTypes", + "objectTypeVar": "httpServerAgentObjectType", + "expandFunc": "expandHttpServerAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nNeither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value.\n", + "behaviour": { + "requiredByApi": true, + "returnedOnRead": false, + "returnedOnUpdate": false + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandHttpServerAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get HTTP Server test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "HttpServer" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_HttpServerTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/http-server" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "HttpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_HttpServerTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/http-server/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "HttpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_HttpServerTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/http-server/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "HttpServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/http-server/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_HttpServerTestRequest", + "responseType": "models.Tests_API_HttpServerTestResponseable", + "constructorExpr": "models.NewTests_API_HttpServerTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + }, + { + "attr": "desired_status_code", + "hcl": "\"200\"" + }, + { + "attr": "dns_override", + "hcl": "\"8.8.8.8\"" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "headers", + "hcl": "[\"X-Tfacc: yes\"]", + "wire": [ + "X-Tfacc: yes" + ] + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "url", + "hcl": "\"https://www.example.com\"" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_page_load.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_page_load.blueprint.json new file mode 100644 index 00000000..6b7d66e7 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_page_load.blueprint.json @@ -0,0 +1,3104 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_page_load", + "name": "tests_page_load", + "goPackage": "tests_page_load", + "goPackageAlias": "v7TestsPageLoad", + "goTypeName": "TestsPageLoadResource", + "modelTypeName": "TestsPageLoadResourceModel", + "serviceGroup": "page_load_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "agent_interfaces", + "goField": "AgentInterfaces", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadAgentInterfacesModel", + "sdkType": "page_load_tests.AgentInterfaces", + "attrTypesVar": "testsPageLoadAgentInterfacesAttrTypes", + "objectTypeVar": "testsPageLoadAgentInterfacesObjectType", + "expandFunc": "expandTestsPageLoadAgentInterfaces", + "flattenFunc": "flattenTestsPageLoadAgentInterfaces", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The agent ID of the enterprise agent for the test.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentID", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address of the agent interface.", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "agentInterfaces", + "sdkField": "AgentInterfaces", + "sdkGoType": "*page_load_tests.AgentInterfaces", + "expand": { + "func": "expandTestsPageLoadAgentInterfaces", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsPageLoadAgentInterfaces", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadAlertRuleModel", + "sdkType": "page_load_tests.AlertRule", + "attrTypesVar": "testsPageLoadAlertRuleAttrTypes", + "objectTypeVar": "testsPageLoadAlertRuleObjectType", + "expandFunc": "expandTestsPageLoadAlertRules", + "flattenFunc": "flattenTestsPageLoadAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "page_load_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "page_load_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "page_load_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "page_load_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "page_load_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]page_load_tests.AlertRule", + "expand": { + "func": "expandTestsPageLoadAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsPageLoadAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\n\nObserved: the API assigns true when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_geolocation", + "goField": "AllowGeolocation", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set true to use the agent\u2019s geolocation by the web page.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowGeolocation", + "sdkField": "AllowGeolocation", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_mic_and_camera", + "goField": "AllowMicAndCamera", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set true allow the use of a fake mic and camera in the browser.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowMicAndCamera", + "sdkField": "AllowMicAndCamera", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_unsafe_legacy_renegotiation", + "goField": "AllowUnsafeLegacyRenegotiation", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowUnsafeLegacyRenegotiation", + "sdkField": "AllowUnsafeLegacyRenegotiation", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm", + "kerberos", + "oauth" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP authentication type.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "*models.Tests_API_TestAuthType", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestAuthType" + ], + "extraArgs": [ + "models.ParseTests_API_TestAuthType" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "block_domains", + "goField": "BlockDomains", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.\n\n\nObserved: the API assigns \"\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"\"" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "blockDomains", + "sdkField": "BlockDomains", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "browser_language", + "goField": "BrowserLanguage", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set one of the available browser language that you want to use to configure the browser.\n\n\nObserved: the API assigns \"en-US\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"en-US\"" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "browserLanguage", + "sdkField": "BrowserLanguage", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "chrome_options", + "goField": "ChromeOptions", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Command-line options passed to Chrome when running the test.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "chromeOptions", + "sdkField": "ChromeOptions", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "chrome_policies", + "goField": "ChromePolicies", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "JSON string of Chrome policy settings to apply.", + "wire": { + "jsonPath": "chromePolicies", + "sdkField": "ChromePolicies", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.TestChromePolicies" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + }, + "drop": true + }, + { + "name": "client_certificate", + "goField": "ClientCertificate", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "clientCertificate", + "sdkField": "ClientCertificate", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "collect_proxy_network_data", + "goField": "CollectProxyNetworkData", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether network data to the proxy should be collected.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "collectProxyNetworkData", + "sdkField": "CollectProxyNetworkData", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "content_regex", + "goField": "ContentRegex", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Content regex, this field does not require escaping.\n\n\nObserved: the API assigns \"\" when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"\"" + } + }, + "wire": { + "jsonPath": "contentRegex", + "sdkField": "ContentRegex", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "custom_headers", + "goField": "CustomHeaders", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestCustomHeadersModel", + "sdkType": "page_load_tests.TestCustomHeaders", + "attrTypesVar": "testsPageLoadTestCustomHeadersAttrTypes", + "objectTypeVar": "testsPageLoadTestCustomHeadersObjectType", + "expandFunc": "expandTestsPageLoadTestCustomHeaders", + "flattenFunc": "flattenTestsPageLoadTestCustomHeaders", + "attributes": [ + { + "name": "all", + "goField": "All", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for all domains.", + "wire": { + "jsonPath": "all", + "sdkField": "All", + "sdkGoType": "any" + } + }, + { + "name": "domains", + "goField": "Domains", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for the specified domains.", + "wire": { + "jsonPath": "domains", + "sdkField": "Domains", + "sdkGoType": "any" + } + }, + { + "name": "root", + "goField": "Root", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for root server request.", + "wire": { + "jsonPath": "root", + "sdkField": "Root", + "sdkGoType": "any" + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "customHeaders", + "sdkField": "CustomHeaders", + "sdkGoType": "*page_load_tests.TestCustomHeaders", + "expand": { + "func": "expandTestsPageLoadTestCustomHeaders", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsPageLoadTestCustomHeaders", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "desired_status_code", + "goField": "DesiredStatusCode", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "desiredStatusCode", + "sdkField": "DesiredStatusCode", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "disable_screenshot", + "goField": "DisableScreenshot", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Enables or disables screenshots on error. Set true to not capture\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "disableScreenshot", + "sdkField": "DisableScreenshot", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "distributed_tracing", + "goField": "DistributedTracing", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Adds distributed tracing headers to API requests using B3 and W3C standards.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "distributedTracing", + "sdkField": "DistributedTracing", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "dns_override", + "goField": "DNSOverride", + "type": { + "kind": "string", + "constraints": { + "format": "ipv4" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address to use for DNS override.\n\nWrite-only on this endpoint: the read never reports it (local acceptance run, 2026-08-03); state carries the configured value.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "dnsOverride", + "sdkField": "DnsOverride", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "download_limit", + "goField": "DownloadLimit", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specifies maximum number of bytes to download from the target object.\n\nThis endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "downloadLimit", + "sdkField": "DownloadLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "skipFlatten": true + } + }, + { + "name": "emulated_device_id", + "goField": "EmulatedDeviceID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "ID of the emulated device, if one was given when the test was created.\n\n\nObserved: the API assigns \"281474976710656\" when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "\"281474976710656\"" + } + }, + "wire": { + "jsonPath": "emulatedDeviceId", + "sdkField": "EmulatedDeviceId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "follow_redirects", + "goField": "FollowRedirects", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "followRedirects", + "sdkField": "FollowRedirects", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "http_interval", + "goField": "HTTPInterval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP test run interval. The interval between HTTP test runs in seconds cannot exceed the specified interval value and defaults to the same value as the interval if not set.\n\nDocumented values: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpInterval", + "sdkField": "HttpInterval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_target_time", + "goField": "HTTPTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 100, + "maximum": 5000 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for HTTP server completion, specified in milliseconds.\n\n\nObserved: the API assigns 1000 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "1000" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTargetTime", + "sdkField": "HttpTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_time_limit", + "goField": "HTTPTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP time limit in seconds.\n\n\nObserved: the API assigns 5 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "5" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTimeLimit", + "sdkField": "HttpTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_version", + "goField": "HTTPVersion", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 2 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.\n\n\nObserved: the API assigns 2 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "2" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpVersion", + "sdkField": "HttpVersion", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "identify_agent_traffic_with_user_agent", + "goField": "IdentifyAgentTrafficWithUserAgent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Determines how agent traffic is identified:\n\n* `false`: Adds the `x-thousandeyes-agent: yes` header.\n* `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header.\n\nFor more information, see [Notes on Agent ID Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy).\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "identifyAgentTrafficWithUserAgent", + "sdkField": "IdentifyAgentTrafficWithUserAgent", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "include_headers", + "goField": "IncludeHeaders", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to capture response headers for objects loaded by the test.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "includeHeaders", + "sdkField": "IncludeHeaders", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestLabelsModel", + "sdkType": "page_load_tests.TestLabels", + "attrTypesVar": "testsPageLoadTestLabelsAttrTypes", + "objectTypeVar": "testsPageLoadTestLabelsObjectType", + "expandFunc": "expandTestsPageLoadTestLabelses", + "flattenFunc": "flattenTestsPageLoadTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]page_load_tests.TestLabels", + "flatten": { + "func": "flattenTestsPageLoadTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestBGPMonitorsModel", + "sdkType": "page_load_tests.TestBgpMonitors", + "attrTypesVar": "testsPageLoadTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsPageLoadTestBGPMonitorsObjectType", + "expandFunc": "expandTestsPageLoadTestBGPMonitorses", + "flattenFunc": "flattenTestsPageLoadTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "page_load_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]page_load_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsPageLoadTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nObserved: the API assigns true when this is omitted.\n\n\nComputed only on this endpoint: browser tests always network-measure, and the SDK's value-typed omitempty bool cannot express false anyway (local acceptance run, 2026-08-03).", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + } + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nObserved: the API assigns 3 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "3" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "o_auth", + "goField": "OAuth", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadOAuthModel", + "sdkType": "page_load_tests.OAuth", + "attrTypesVar": "testsPageLoadOAuthAttrTypes", + "objectTypeVar": "testsPageLoadOAuthObjectType", + "expandFunc": "expandTestsPageLoadOAuth", + "flattenFunc": "flattenTestsPageLoadOAuth", + "attributes": [ + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP authentication type used for the OAuth request.", + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "page_load_tests.OAuthAuthType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.OAuthAuthType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "headers", + "goField": "Headers", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Request headers used for OAuth.", + "wire": { + "jsonPath": "headers", + "sdkField": "Headers", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth password", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "post_body", + "goField": "PostBody", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enter the OAuth body for the HTTP POST request in this field when using OAuth as the authentication mechanism. No special escaping is required. The value is saved only when `requestMethod` is set to `post`.", + "wire": { + "jsonPath": "postBody", + "sdkField": "PostBody", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "request_method", + "goField": "RequestMethod", + "type": { + "kind": "string", + "allowedValues": [ + "get", + "post" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP request method.", + "wire": { + "jsonPath": "requestMethod", + "sdkField": "RequestMethod", + "sdkGoType": "page_load_tests.RequestMethod", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.RequestMethod" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "test_url", + "goField": "TestURL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.", + "wire": { + "jsonPath": "testUrl", + "sdkField": "TestURL", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "page_load_tests.TestUrl" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth username", + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use this only if you want to use OAuth as the authentication mechanism.", + "wire": { + "jsonPath": "oAuth", + "sdkField": "OAuth", + "sdkGoType": "*page_load_tests.OAuth", + "expand": { + "func": "expandTestsPageLoadOAuth", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsPageLoadOAuth", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "override_agent_proxy", + "goField": "OverrideAgentProxy", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideAgentProxy", + "sdkField": "OverrideAgentProxy", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "override_proxy_id", + "goField": "OverrideProxyID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "ID of the proxy to be used if the default proxy is overridden.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideProxyId", + "sdkField": "OverrideProxyId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "page_load_target_time", + "goField": "PageLoadTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`.\n\n\nObserved: the API assigns 6 when this is omitted.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "6" + } + }, + "wire": { + "jsonPath": "pageLoadTargetTime", + "sdkField": "PageLoadTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "page_load_time_limit", + "goField": "PageLoadTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Page load time limit. Must be larger than the `httpTimeLimit`.\n\n\nObserved: the API assigns 10 when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "10" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pageLoadTimeLimit", + "sdkField": "PageLoadTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "page_loading_strategy", + "goField": "PageLoadingStrategy", + "type": { + "kind": "string", + "allowedValues": [ + "normal", + "eager", + "none" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "* `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. \n* `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script.\n* `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pageLoadingStrategy", + "sdkField": "PageLoadingStrategy", + "sdkGoType": "*models.Tests_API_TestPageLoadingStrategy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPageLoadingStrategy" + ], + "extraArgs": [ + "models.ParseTests_API_TestPageLoadingStrategy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Password for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nValues accepted here: `tcp`, `icmp`.\nThe specification documents `udp`, which the API rejected.\nObserved: the API assigns \"tcp\" when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "immutable": false, + "serverDefault": { + "kind": "", + "raw": "\"tcp\"" + }, + "zeroValueUnsendable": true, + "acceptedValues": [ + "tcp", + "icmp" + ], + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestSharedAccountsModel", + "sdkType": "page_load_tests.TestSharedAccounts", + "attrTypesVar": "testsPageLoadTestSharedAccountsAttrTypes", + "objectTypeVar": "testsPageLoadTestSharedAccountsObjectType", + "expandFunc": "expandTestsPageLoadTestSharedAccountses", + "flattenFunc": "flattenTestsPageLoadTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]page_load_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsPageLoadTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "ssl_version", + "goField": "SSLVersion", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Reflects the verbose SSL protocol version used by a test.", + "wire": { + "jsonPath": "sslVersion", + "sdkField": "SslVersion", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ssl_version_id", + "goField": "SSLVersionID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "3", + "4", + "5", + "6", + "7" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "sslVersionId", + "sdkField": "SslVersionId", + "sdkGoType": "*models.Tests_API_TestSslVersionId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestSslVersionId" + ], + "extraArgs": [ + "models.ParseTests_API_TestSslVersionId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "subinterval", + "goField": "Subinterval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1200", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval.\n\nDocumented values: `60`, `120`, `300`, `600`, `900`, `1200`, `1800`, `3600`.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "subinterval", + "sdkField": "Subinterval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestTagsModel", + "sdkType": "page_load_tests.TestTags", + "attrTypesVar": "testsPageLoadTestTagsAttrTypes", + "objectTypeVar": "testsPageLoadTestTagsObjectType", + "expandFunc": "expandTestsPageLoadTestTagses", + "flattenFunc": "flattenTestsPageLoadTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]page_load_tests.TestTags", + "flatten": { + "func": "flattenTestsPageLoadTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string", + "allowedValues": [ + "api", + "agent-to-agent", + "agent-to-server", + "bgp", + "http-server", + "page-load", + "web-transactions", + "ftp-server", + "dns-trace", + "dns-server", + "dnssec", + "sip-server", + "voice" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "use_ntlm", + "goField": "UseNtlm", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.\n\n\nObserved: the API assigns false when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "false" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "useNtlm", + "sdkField": "UseNtlm", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "user_agent", + "goField": "UserAgent", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "User-agent string to be provided during the test.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "userAgent", + "sdkField": "UserAgent", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Username for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "vault_credentials", + "goField": "VaultCredentials", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsPageLoadTestVaultCredentialModel", + "sdkType": "models.Tests_API_TestVaultCredentialable", + "attrTypesVar": "testsPageLoadTestVaultCredentialAttrTypes", + "objectTypeVar": "testsPageLoadTestVaultCredentialObjectType", + "expandFunc": "expandTestsPageLoadTestVaultCredentials", + "flattenFunc": "flattenTestsPageLoadTestVaultCredentials", + "attributes": [ + { + "name": "secret_id", + "goField": "SecretID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "UUID of the configured secret.", + "wire": { + "jsonPath": "secretId", + "sdkField": "SecretId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "target", + "goField": "Target", + "type": { + "kind": "string", + "allowedValues": [ + "username", + "password", + "script" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The target setting that the credential should be used for.\n\n\nValues accepted here: `username`, `password`, `script`.\nThe API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute.\n", + "behaviour": { + "acceptedValues": [ + "username", + "password", + "script" + ], + "valuesClosed": false + }, + "wire": { + "jsonPath": "target", + "sdkField": "Target", + "sdkGoType": "*models.Tests_API_TestVaultCredentialTarget", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestVaultCredentialTarget" + ], + "extraArgs": [ + "models.ParseTests_API_TestVaultCredentialTarget" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_TestVaultCredential()" + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "List of credential IDs that are stored in an external vault.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "vaultCredentials", + "sdkField": "VaultCredentials", + "sdkGoType": "[]models.Tests_API_TestVaultCredentialable", + "expand": { + "func": "expandTestsPageLoadTestVaultCredentials", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsPageLoadTestVaultCredentials", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "verify_certificate", + "goField": "VerifyCertificate", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.\n\n\nObserved: the API assigns true when this is omitted.\n\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "serverDefault": { + "kind": "", + "raw": "true" + }, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "verifyCertificate", + "sdkField": "VerifyCertificate", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "PageLoadAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "pageLoadAgentAttrTypes", + "objectTypeVar": "pageLoadAgentObjectType", + "expandFunc": "expandPageLoadAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.\n\n\nThe API enforces this field's presence, which the specification does not declare.\n", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandPageLoadAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get Page Load test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "PageLoad" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_PageLoadTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/page-load" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "PageLoad" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_PageLoadTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/page-load/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "PageLoad" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_PageLoadTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/page-load/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "PageLoad" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/page-load/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_PageLoadTestRequest", + "responseType": "models.Tests_API_PageLoadTestResponseable", + "constructorExpr": "models.NewTests_API_PageLoadTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "url", + "hcl": "\"https://www.example.com\"" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + }, + { + "attr": "dns_override", + "hcl": "\"8.8.8.8\"" + }, + { + "attr": "http_interval", + "hcl": "3600" + }, + { + "attr": "desired_status_code", + "hcl": "\"200\"" + }, + { + "attr": "chrome_options", + "hcl": "\"--disable-gpu\"" + }, + { + "attr": "collect_proxy_network_data", + "hcl": "false" + }, + { + "attr": "use_ntlm", + "hcl": "false" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_sip_server.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_sip_server.blueprint.json new file mode 100644 index 00000000..f0594ca6 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_sip_server.blueprint.json @@ -0,0 +1,1904 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_sip_server", + "name": "tests_sip_server", + "goPackage": "tests_sip_server", + "goPackageAlias": "v7TestsSIPServer", + "goTypeName": "TestsSIPServerResource", + "modelTypeName": "TestsSIPServerResourceModel", + "serviceGroup": "sip_server_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerAlertRuleModel", + "sdkType": "sip_server_tests.AlertRule", + "attrTypesVar": "testsSIPServerAlertRuleAttrTypes", + "objectTypeVar": "testsSIPServerAlertRuleObjectType", + "expandFunc": "expandTestsSIPServerAlertRules", + "flattenFunc": "flattenTestsSIPServerAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "sip_server_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "sip_server_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "sip_server_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "sip_server_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "sip_server_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]sip_server_tests.AlertRule", + "expand": { + "func": "expandTestsSIPServerAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsSIPServerAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates if alerts are enabled.", + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "auth_user", + "goField": "AuthUser", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Username for authentication with SIP server.", + "wire": { + "jsonPath": "authUser", + "sdkField": "AuthUser", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Test is enabled.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "ipv6_policy", + "goField": "Ipv6Policy", + "type": { + "kind": "string", + "allowedValues": [ + "force-ipv4", + "prefer-ipv6", + "force-ipv6", + "use-agent-policy" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP version policy. Overrides the IPv6 policy configured at the agent level.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "ipv6Policy", + "sdkField": "Ipv6Policy", + "sdkGoType": "*models.Tests_API_TestIpv6Policy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestIpv6Policy" + ], + "extraArgs": [ + "models.ParseTests_API_TestIpv6Policy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerTestLabelsModel", + "sdkType": "sip_server_tests.TestLabels", + "attrTypesVar": "testsSIPServerTestLabelsAttrTypes", + "objectTypeVar": "testsSIPServerTestLabelsObjectType", + "expandFunc": "expandTestsSIPServerTestLabelses", + "flattenFunc": "flattenTestsSIPServerTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]sip_server_tests.TestLabels", + "flatten": { + "func": "flattenTestsSIPServerTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerTestBGPMonitorsModel", + "sdkType": "sip_server_tests.TestBgpMonitors", + "attrTypesVar": "testsSIPServerTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsSIPServerTestBGPMonitorsObjectType", + "expandFunc": "expandTestsSIPServerTestBGPMonitorses", + "flattenFunc": "flattenTestsSIPServerTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "sip_server_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]sip_server_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsSIPServerTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "options_regex", + "goField": "OptionsRegex", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Options regex, this field does not require escaping.", + "wire": { + "jsonPath": "optionsRegex", + "sdkField": "OptionsRegex", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Password for Basic/NTLM authentication.", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "port", + "goField": "Port", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 65535 + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Target port.", + "wire": { + "jsonPath": "port", + "sdkField": "Port", + "sdkGoType": "*int32", + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + }, + "skipExpand": true + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "tls", + "udp" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Transport layer for SIP communication.", + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_SipTestProtocol", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "register_enabled", + "goField": "RegisterEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set to true to perform SIP registration on the test target with the SIP REGISTER command.", + "wire": { + "jsonPath": "registerEnabled", + "sdkField": "RegisterEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerTestSharedAccountsModel", + "sdkType": "sip_server_tests.TestSharedAccounts", + "attrTypesVar": "testsSIPServerTestSharedAccountsAttrTypes", + "objectTypeVar": "testsSIPServerTestSharedAccountsObjectType", + "expandFunc": "expandTestsSIPServerTestSharedAccountses", + "flattenFunc": "flattenTestsSIPServerTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]sip_server_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsSIPServerTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "sip_registrar", + "goField": "SIPRegistrar", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "SIP server to be tested, specified by domain name or IP address.", + "wire": { + "jsonPath": "sipRegistrar", + "sdkField": "SipRegistrar", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sip_target_time", + "goField": "SIPTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 100, + "maximum": 5000 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target time for test completion in milliseconds.", + "wire": { + "jsonPath": "sipTargetTime", + "sdkField": "SipTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "sip_time_limit", + "goField": "SIPTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 10 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Time limit in milliseconds.", + "wire": { + "jsonPath": "sipTimeLimit", + "sdkField": "SipTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerTestTagsModel", + "sdkType": "sip_server_tests.TestTags", + "attrTypesVar": "testsSIPServerTestTagsAttrTypes", + "objectTypeVar": "testsSIPServerTestTagsObjectType", + "expandFunc": "expandTestsSIPServerTestTagses", + "flattenFunc": "flattenTestsSIPServerTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]sip_server_tests.TestTags", + "flatten": { + "func": "flattenTestsSIPServerTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "target_sip_credentials", + "goField": "TargetSIPCredentials", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsSIPServerTestSIPCredentialsModel", + "sdkType": "sip_server_tests.TestSipCredentials", + "attrTypesVar": "testsSIPServerTestSIPCredentialsAttrTypes", + "objectTypeVar": "testsSIPServerTestSIPCredentialsObjectType", + "expandFunc": "expandTestsSIPServerTestSIPCredentials", + "flattenFunc": "", + "attributes": [ + { + "name": "auth_user", + "goField": "AuthUser", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Username for authentication with SIP server.", + "wire": { + "jsonPath": "authUser", + "sdkField": "AuthUser", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.TestSipAuthUser" + ] + }, + "skipFlatten": true + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Password for Basic/NTLM authentication.", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.TestPassword" + ] + }, + "skipFlatten": true + } + }, + { + "name": "port", + "goField": "Port", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 65535 + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "Target port.", + "wire": { + "jsonPath": "port", + "sdkField": "Port", + "sdkGoType": "*int64", + "expand": { + "func": "convert.FrameworkToIntEnum", + "typeArgs": [ + "sip_server_tests.TestPort" + ] + }, + "skipFlatten": true + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "tls", + "udp" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Transport layer for SIP communication.", + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "sip_server_tests.SipTestProtocol", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.SipTestProtocol" + ] + }, + "skipFlatten": true + } + }, + { + "name": "sip_registrar", + "goField": "SIPRegistrar", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "SIP server to be tested, specified by domain name or IP address.", + "wire": { + "jsonPath": "sipRegistrar", + "sdkField": "SipRegistrar", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.TestSipRegistrar" + ] + }, + "skipFlatten": true + } + }, + { + "name": "user", + "goField": "User", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Username for SIP registration, should be unique within a ThousandEyes account group.", + "wire": { + "jsonPath": "user", + "sdkField": "User", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "sip_server_tests.TestSipUser" + ] + }, + "skipFlatten": true + } + } + ] + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "Sent on write only: the read reports these credentials through its own top-level fields.", + "wire": { + "jsonPath": "targetSipCredentials", + "sdkField": "TargetSipCredentials", + "sdkGoType": "*sip_server_tests.TestSipCredentials", + "expand": { + "func": "expandTestsSIPServerTestSIPCredentials", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + }, + "drop": true + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The name of the test. Test name must be unique.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string", + "allowedValues": [ + "api", + "agent-to-agent", + "agent-to-server", + "bgp", + "http-server", + "page-load", + "web-transactions", + "ftp-server", + "dns-trace", + "dns-server", + "dnssec", + "sip-server", + "voice" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "user", + "goField": "User", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Username for SIP registration, should be unique within a ThousandEyes account group.", + "wire": { + "jsonPath": "user", + "sdkField": "User", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "SipServerAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "sipServerAgentAttrTypes", + "objectTypeVar": "sipServerAgentObjectType", + "expandFunc": "expandSipServerAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.", + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandSipServerAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get SIP Server test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "SipServer" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_SipServerTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/sip-server" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "SipServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_SipServerTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/sip-server/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "SipServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_SipServerTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/sip-server/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "SipServer" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/sip-server/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_SipServerTestRequest", + "responseType": "models.Tests_API_SipServerTestResponseable", + "constructorExpr": "models.NewTests_API_SipServerTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "network_measurements", + "hcl": "false" + } + ] + }, + "accTest": { + "skipUnlessEnv": "TFPFGEN_ACC_SIP" + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_voice.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_voice.blueprint.json new file mode 100644 index 00000000..8df5e94e --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_voice.blueprint.json @@ -0,0 +1,1534 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_voice", + "name": "tests_voice", + "goPackage": "tests_voice", + "goPackageAlias": "v7TestsVoice", + "goTypeName": "TestsVoiceResource", + "modelTypeName": "TestsVoiceResourceModel", + "serviceGroup": "voice_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsVoiceAlertRuleModel", + "sdkType": "voice_tests.AlertRule", + "attrTypesVar": "testsVoiceAlertRuleAttrTypes", + "objectTypeVar": "testsVoiceAlertRuleObjectType", + "expandFunc": "expandTestsVoiceAlertRules", + "flattenFunc": "flattenTestsVoiceAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "voice_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "voice_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "voice_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "voice_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "voice_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "voice_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "voice_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "voice_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]voice_tests.AlertRule", + "expand": { + "func": "expandTestsVoiceAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsVoiceAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates if alerts are enabled.", + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "codec", + "goField": "Codec", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Codec label", + "wire": { + "jsonPath": "codec", + "sdkField": "Codec", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "codec_id", + "goField": "CodecID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Codec identifier for the RTP stream. Valid values:\n\n* `0`: G.711 @ 64 Kbps\n* `1`: G.722.1 @ 24 Kbps (WB)\n* `2`: G.722.1 @ 32 Kbps (WB)\n* `3`: G.726 @ 32 Kbps\n* `4`: G.723.1 @ 6.4 Kbps\n* `5`: G.729a @ 8 Kbps\n* `6`: RTAudio @ 45 Kbps (WB)\n* `7`: RTAudio @ 27.8 Kbps\n* `8`: SILK @ 36 Kbps (WB)\n* `9`: G.722 @ 64 Kbps (WB)", + "wire": { + "jsonPath": "codecId", + "sdkField": "CodecId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "dscp", + "goField": "Dscp", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "DSCP label.", + "wire": { + "jsonPath": "dscp", + "sdkField": "Dscp", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "dscp_id", + "goField": "DscpID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "8", + "16", + "24", + "32", + "40", + "48", + "56", + "10", + "12", + "14", + "18", + "20", + "22", + "26", + "28", + "30", + "34", + "36", + "38", + "46", + "44" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests)\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "dscpId", + "sdkField": "DscpId", + "sdkGoType": "*models.Tests_API_TestDscpId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestDscpId" + ], + "extraArgs": [ + "models.ParseTests_API_TestDscpId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "duration", + "goField": "Duration", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 30 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Duration of the test in seconds.", + "wire": { + "jsonPath": "duration", + "sdkField": "Duration", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Test is enabled.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "jitter_buffer", + "goField": "JitterBuffer", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 150 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "De-jitter buffer size in seconds.", + "wire": { + "jsonPath": "jitterBuffer", + "sdkField": "JitterBuffer", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsVoiceTestLabelsModel", + "sdkType": "voice_tests.TestLabels", + "attrTypesVar": "testsVoiceTestLabelsAttrTypes", + "objectTypeVar": "testsVoiceTestLabelsObjectType", + "expandFunc": "expandTestsVoiceTestLabelses", + "flattenFunc": "flattenTestsVoiceTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]voice_tests.TestLabels", + "flatten": { + "func": "flattenTestsVoiceTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsVoiceTestBGPMonitorsModel", + "sdkType": "voice_tests.TestBgpMonitors", + "attrTypesVar": "testsVoiceTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsVoiceTestBGPMonitorsObjectType", + "expandFunc": "expandTestsVoiceTestBGPMonitorses", + "flattenFunc": "flattenTestsVoiceTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IPAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "voice_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]voice_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsVoiceTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Number of path traces executed by the agent.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "port", + "goField": "Port", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1024, + "maximum": 65535 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Port number for the chosen protocol.", + "wire": { + "jsonPath": "port", + "sdkField": "Port", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsVoiceTestSharedAccountsModel", + "sdkType": "voice_tests.TestSharedAccounts", + "attrTypesVar": "testsVoiceTestSharedAccountsAttrTypes", + "objectTypeVar": "testsVoiceTestSharedAccountsObjectType", + "expandFunc": "expandTestsVoiceTestSharedAccountses", + "flattenFunc": "flattenTestsVoiceTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]voice_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsVoiceTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsVoiceTestTagsModel", + "sdkType": "voice_tests.TestTags", + "attrTypesVar": "testsVoiceTestTagsAttrTypes", + "objectTypeVar": "testsVoiceTestTagsObjectType", + "expandFunc": "expandTestsVoiceTestTagses", + "flattenFunc": "flattenTestsVoiceTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]voice_tests.TestTags", + "flatten": { + "func": "flattenTestsVoiceTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "target_agent_id", + "goField": "TargetAgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "Agent ID of the target agent for the test.", + "wire": { + "jsonPath": "targetAgentId", + "sdkField": "TargetAgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The name of the test. Test name must be unique.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "VoiceAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "voiceAgentAttrTypes", + "objectTypeVar": "voiceAgentObjectType", + "expandFunc": "expandVoiceAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.", + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandVoiceAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get Voice test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Voice" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_VoiceTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/voice" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Voice" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_VoiceTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/voice/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Voice" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_VoiceTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/voice/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "Voice" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/voice/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_VoiceTestRequest", + "responseType": "models.Tests_API_VoiceTestResponseable", + "constructorExpr": "models.NewTests_API_VoiceTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "interval", + "hcl": "3600" + } + ] + }, + "accTest": { + "skipUnlessEnv": "TFPFGEN_ACC_ENTERPRISE" + } + } + ] +} \ No newline at end of file diff --git a/blueprints/thousandeyes-kiota/resources/tests_web_transaction.blueprint.json b/blueprints/thousandeyes-kiota/resources/tests_web_transaction.blueprint.json new file mode 100644 index 00000000..87a65d43 --- /dev/null +++ b/blueprints/thousandeyes-kiota/resources/tests_web_transaction.blueprint.json @@ -0,0 +1,2984 @@ +{ + "formatVersion": "4", + "resources": [ + { + "key": "tests_web_transaction", + "name": "tests_web_transaction", + "goPackage": "tests_web_transaction", + "goPackageAlias": "v7TestsWebTransaction", + "goTypeName": "TestsWebTransactionResource", + "modelTypeName": "TestsWebTransactionResourceModel", + "serviceGroup": "web_transaction_tests", + "apiVersionDir": "v7", + "schema": { + "attributes": [ + { + "name": "agent_interfaces", + "goField": "AgentInterfaces", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionAgentInterfacesModel", + "sdkType": "web_transaction_tests.AgentInterfaces", + "attrTypesVar": "testsWebTransactionAgentInterfacesAttrTypes", + "objectTypeVar": "testsWebTransactionAgentInterfacesObjectType", + "expandFunc": "expandTestsWebTransactionAgentInterfaces", + "flattenFunc": "flattenTestsWebTransactionAgentInterfaces", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The agent ID of the enterprise agent for the test.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentID", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address of the agent interface.", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "agentInterfaces", + "sdkField": "AgentInterfaces", + "sdkGoType": "*web_transaction_tests.AgentInterfaces", + "expand": { + "func": "expandTestsWebTransactionAgentInterfaces", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsWebTransactionAgentInterfaces", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alert_rules", + "goField": "AlertRules", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionAlertRuleModel", + "sdkType": "web_transaction_tests.AlertRule", + "attrTypesVar": "testsWebTransactionAlertRuleAttrTypes", + "objectTypeVar": "testsWebTransactionAlertRuleObjectType", + "expandFunc": "expandTestsWebTransactionAlertRules", + "flattenFunc": "flattenTestsWebTransactionAlertRules", + "attributes": [ + { + "name": "alert_type", + "goField": "AlertType", + "type": { + "kind": "string", + "allowedValues": [ + "page-load", + "http-server", + "end-to-end-server", + "end-to-end-agent", + "voice", + "dns-server", + "dns-trace", + "dnssec", + "bgp", + "path-trace", + "ftp", + "sip-server", + "transactions", + "web-transactions", + "agent", + "network-outage", + "application-outage", + "device-device", + "device-interface", + "endpoint-network-server", + "endpoint-http-server", + "endpoint-path-trace", + "endpoint-browser-sessions-agent", + "endpoint-browser-sessions-application", + "api", + "web-transaction", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Type of alert being triggered. In multi-layered tests, this value represents the layer the alert relates to. See [Alert Details](https://developer.cisco.com/docs/thousandeyes/retrieve-alert-details/) documentation for a list of possible values", + "wire": { + "jsonPath": "alertType", + "sdkField": "AlertType", + "sdkGoType": "web_transaction_tests.AlertType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.AlertType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "direction", + "goField": "Direction", + "type": { + "kind": "string", + "allowedValues": [ + "to-target", + "from-target", + "bidirectional" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Direction for applicable alert types (eg. path trace, End-to-End (Agent) etc.)", + "wire": { + "jsonPath": "direction", + "sdkField": "Direction", + "sdkGoType": "web_transaction_tests.AlertDirection", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.AlertDirection" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "expression", + "goField": "Expression", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "String expression of alert rule", + "wire": { + "jsonPath": "expression", + "sdkField": "Expression", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "is_default", + "goField": "IsDefault", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Alert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here", + "wire": { + "jsonPath": "isDefault", + "sdkField": "IsDefault", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources", + "goField": "MinimumSources", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "The minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSources", + "sdkField": "MinimumSources", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "minimum_sources_pct", + "goField": "MinimumSourcesPct", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "the minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert", + "wire": { + "jsonPath": "minimumSourcesPct", + "sdkField": "MinimumSourcesPct", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_mode", + "goField": "RoundsViolatingMode", + "type": { + "kind": "string", + "allowedValues": [ + "exact", + "any", + "auto" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "`exact` requires the same agents to meet the threshold in consecutive rounds. `auto` is only enabled for CEA and Endpoint Scheduled test rules. The default is `any`.", + "wire": { + "jsonPath": "roundsViolatingMode", + "sdkField": "RoundsViolatingMode", + "sdkGoType": "web_transaction_tests.AlertRoundsViolationMode", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_out_of", + "goField": "RoundsViolatingOutOf", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the divisor (y value) for the \u201cX of Y times\u201d condition.", + "wire": { + "jsonPath": "roundsViolatingOutOf", + "sdkField": "RoundsViolatingOutOf", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rounds_violating_required", + "goField": "RoundsViolatingRequired", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Specifies the numerator (x value) for the \u201cX of Y times\u201d condition", + "wire": { + "jsonPath": "roundsViolatingRequired", + "sdkField": "RoundsViolatingRequired", + "sdkGoType": "*int64", + "flatten": { + "func": "convert.PtrInt64ToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_id", + "goField": "RuleID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique ID of the rule.", + "wire": { + "jsonPath": "ruleId", + "sdkField": "RuleID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "rule_name", + "goField": "RuleName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the alert rule", + "wire": { + "jsonPath": "ruleName", + "sdkField": "RuleName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "sensitivity_level", + "goField": "SensitivityLevel", + "type": { + "kind": "string", + "allowedValues": [ + "high", + "medium", + "low" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Used when `roundsViolatingMode` is set to `auto`. The default is `medium`. Higher sensitivity increases the likelihood of triggering alerts.", + "wire": { + "jsonPath": "sensitivityLevel", + "sdkField": "SensitivityLevel", + "sdkGoType": "web_transaction_tests.SensitivityLevel", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "severity", + "goField": "Severity", + "type": { + "kind": "string", + "allowedValues": [ + "info", + "major", + "minor", + "critical", + "unknown" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The severity of the alert.", + "wire": { + "jsonPath": "severity", + "sdkField": "Severity", + "sdkGoType": "web_transaction_tests.Severity", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.Severity" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains list of enabled alert rule objects.", + "wire": { + "jsonPath": "alertRules", + "sdkField": "AlertRules", + "sdkGoType": "[]web_transaction_tests.AlertRule", + "expand": { + "func": "expandTestsWebTransactionAlertRules", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsWebTransactionAlertRules", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "alerts_enabled", + "goField": "AlertsEnabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates if alerts are enabled.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "alertsEnabled", + "sdkField": "AlertsEnabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_geolocation", + "goField": "AllowGeolocation", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set true to use the agent\u2019s geolocation by the web page.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowGeolocation", + "sdkField": "AllowGeolocation", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_mic_and_camera", + "goField": "AllowMicAndCamera", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set true allow the use of a fake mic and camera in the browser.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowMicAndCamera", + "sdkField": "AllowMicAndCamera", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "allow_unsafe_legacy_renegotiation", + "goField": "AllowUnsafeLegacyRenegotiation", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "allowUnsafeLegacyRenegotiation", + "sdkField": "AllowUnsafeLegacyRenegotiation", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm", + "kerberos", + "oauth" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP authentication type.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "*models.Tests_API_TestAuthType", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestAuthType" + ], + "extraArgs": [ + "models.ParseTests_API_TestAuthType" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "bandwidth_measurements", + "goField": "BandwidthMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bandwidthMeasurements", + "sdkField": "BandwidthMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "bgp_measurements", + "goField": "BGPMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to enable bgp measurements.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "bgpMeasurements", + "sdkField": "BgpMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "block_domains", + "goField": "BlockDomains", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "blockDomains", + "sdkField": "BlockDomains", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "browser_language", + "goField": "BrowserLanguage", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set one of the available browser language that you want to use to configure the browser.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "browserLanguage", + "sdkField": "BrowserLanguage", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "chrome_options", + "goField": "ChromeOptions", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Command-line options passed to Chrome when running the test.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "chromeOptions", + "sdkField": "ChromeOptions", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "chrome_policies", + "goField": "ChromePolicies", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "JSON string of Chrome policy settings to apply.", + "wire": { + "jsonPath": "chromePolicies", + "sdkField": "ChromePolicies", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.TestChromePolicies" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + }, + "drop": true + }, + { + "name": "client_certificate", + "goField": "ClientCertificate", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "clientCertificate", + "sdkField": "ClientCertificate", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "collect_proxy_network_data", + "goField": "CollectProxyNetworkData", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether network data to the proxy should be collected.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "collectProxyNetworkData", + "sdkField": "CollectProxyNetworkData", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "content_regex", + "goField": "ContentRegex", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Content regex, this field does not require escaping.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "contentRegex", + "sdkField": "ContentRegex", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "created_by", + "goField": "CreatedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that created the test.", + "wire": { + "jsonPath": "createdBy", + "sdkField": "CreatedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "created_date", + "goField": "CreatedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC created date (ISO date-time format).", + "wire": { + "jsonPath": "createdDate", + "sdkField": "CreatedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "credentials", + "goField": "Credentials", + "type": { + "kind": "set", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).", + "wire": { + "jsonPath": "credentials", + "sdkField": "Credentials", + "sdkGoType": "[]string", + "expand": { + "func": "convert.FrameworkSetToStringSlice", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "convert.StringSliceToFrameworkSet", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "custom_headers", + "goField": "CustomHeaders", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestCustomHeadersModel", + "sdkType": "web_transaction_tests.TestCustomHeaders", + "attrTypesVar": "testsWebTransactionTestCustomHeadersAttrTypes", + "objectTypeVar": "testsWebTransactionTestCustomHeadersObjectType", + "expandFunc": "expandTestsWebTransactionTestCustomHeaders", + "flattenFunc": "flattenTestsWebTransactionTestCustomHeaders", + "attributes": [ + { + "name": "all", + "goField": "All", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for all domains.", + "wire": { + "jsonPath": "all", + "sdkField": "All", + "sdkGoType": "any" + } + }, + { + "name": "domains", + "goField": "Domains", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for the specified domains.", + "wire": { + "jsonPath": "domains", + "sdkField": "Domains", + "sdkGoType": "any" + } + }, + { + "name": "root", + "goField": "Root", + "type": { + "kind": "map", + "elementType": { + "kind": "string" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use these HTTP headers for root server request.", + "wire": { + "jsonPath": "root", + "sdkField": "Root", + "sdkGoType": "any" + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "wire": { + "jsonPath": "customHeaders", + "sdkField": "CustomHeaders", + "sdkGoType": "*web_transaction_tests.TestCustomHeaders", + "expand": { + "func": "expandTestsWebTransactionTestCustomHeaders", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsWebTransactionTestCustomHeaders", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "description", + "goField": "Description", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "A description of the test.", + "wire": { + "jsonPath": "description", + "sdkField": "Description", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "desired_status_code", + "goField": "DesiredStatusCode", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "desiredStatusCode", + "sdkField": "DesiredStatusCode", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "disable_screenshot", + "goField": "DisableScreenshot", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Enables or disables screenshots on error. Set true to not capture\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "disableScreenshot", + "sdkField": "DisableScreenshot", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "distributed_tracing", + "goField": "DistributedTracing", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Adds distributed tracing headers to API requests using B3 and W3C standards.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "distributedTracing", + "sdkField": "DistributedTracing", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "dns_override", + "goField": "DNSOverride", + "type": { + "kind": "string", + "constraints": { + "format": "ipv4" + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "IP address to use for DNS override.\n\nThis endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "dnsOverride", + "sdkField": "DnsOverride", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + }, + { + "name": "download_limit", + "goField": "DownloadLimit", + "type": { + "kind": "int64" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Specifies maximum number of bytes to download from the target object.\n\nThis endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value.", + "behaviour": { + "returnedOnRead": false + }, + "wire": { + "jsonPath": "downloadLimit", + "sdkField": "DownloadLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "skipFlatten": true + } + }, + { + "name": "emulated_device_id", + "goField": "EmulatedDeviceID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "ID of the emulated device, if specified when the test was created.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "emulatedDeviceId", + "sdkField": "EmulatedDeviceId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "enabled", + "goField": "Enabled", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Test is enabled.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "enabled", + "sdkField": "Enabled", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "fixed_packet_rate", + "goField": "FixedPacketRate", + "type": { + "kind": "int64", + "constraints": { + "minimum": 0, + "maximum": 100 + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Sets packets rate sent to measure the network in packets per second.\n\nThis endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "returnedOnRead": false, + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "fixedPacketRate", + "sdkField": "FixedPacketRate", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "skipFlatten": true + } + }, + { + "name": "follow_redirects", + "goField": "FollowRedirects", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "followRedirects", + "sdkField": "FollowRedirects", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "http_target_time", + "goField": "HTTPTargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 100, + "maximum": 5000 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target time for HTTP server completion, specified in milliseconds.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTargetTime", + "sdkField": "HttpTargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_time_limit", + "goField": "HTTPTimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 60 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP time limit in seconds.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpTimeLimit", + "sdkField": "HttpTimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "http_version", + "goField": "HTTPVersion", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 2 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "httpVersion", + "sdkField": "HttpVersion", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "identify_agent_traffic_with_user_agent", + "goField": "IdentifyAgentTrafficWithUserAgent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Determines how agent traffic is identified:\n\n* `false`: Adds the `x-thousandeyes-agent: yes` header.\n* `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header.\n\nFor more information, see [Notes on Agent ID Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy).\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "identifyAgentTrafficWithUserAgent", + "sdkField": "IdentifyAgentTrafficWithUserAgent", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "include_headers", + "goField": "IncludeHeaders", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to `true` to capture response headers for objects loaded by the test.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "includeHeaders", + "sdkField": "IncludeHeaders", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "interval", + "goField": "Interval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Interval between test runs in seconds.\n\nDocumented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`.\n\nThe request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "interval", + "sdkField": "Interval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "labels", + "goField": "Labels", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestLabelsModel", + "sdkType": "web_transaction_tests.TestLabels", + "attrTypesVar": "testsWebTransactionTestLabelsAttrTypes", + "objectTypeVar": "testsWebTransactionTestLabelsObjectType", + "expandFunc": "expandTestsWebTransactionTestLabelses", + "flattenFunc": "flattenTestsWebTransactionTestLabelses", + "attributes": [ + { + "name": "is_builtin", + "goField": "IsBuiltin", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Value indicating if the label in question is BuiltIn (Account Admin, Organization Admin, Regular User).", + "wire": { + "jsonPath": "isBuiltin", + "sdkField": "IsBuiltin", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "label_id", + "goField": "LabelID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Label ID.", + "wire": { + "jsonPath": "labelId", + "sdkField": "LabelID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the label.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Labels to which the test is assigned. This field is not returned for Instant Tests.", + "wire": { + "jsonPath": "labels", + "sdkField": "Labels", + "sdkGoType": "[]web_transaction_tests.TestLabels", + "flatten": { + "func": "flattenTestsWebTransactionTestLabelses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "live_share", + "goField": "LiveShare", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is shared with the account group.", + "wire": { + "jsonPath": "liveShare", + "sdkField": "LiveShare", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_by", + "goField": "ModifiedBy", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "User that modified the test.", + "wire": { + "jsonPath": "modifiedBy", + "sdkField": "ModifiedBy", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "modified_date", + "goField": "ModifiedDate", + "type": { + "kind": "string", + "constraints": { + "format": "date-time" + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "UTC last modification date (ISO date-time format).", + "wire": { + "jsonPath": "modifiedDate", + "sdkField": "ModifiedDate", + "sdkGoType": "*time.Time", + "flatten": { + "func": "convert.PtrTimeToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitors", + "goField": "Monitors", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestBGPMonitorsModel", + "sdkType": "web_transaction_tests.TestBgpMonitors", + "attrTypesVar": "testsWebTransactionTestBGPMonitorsAttrTypes", + "objectTypeVar": "testsWebTransactionTestBGPMonitorsObjectType", + "expandFunc": "expandTestsWebTransactionTestBGPMonitorses", + "flattenFunc": "flattenTestsWebTransactionTestBGPMonitorses", + "attributes": [ + { + "name": "country_id", + "goField": "CountryID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Country ID", + "wire": { + "jsonPath": "countryId", + "sdkField": "CountryID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ip_address", + "goField": "IPAddress", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "IP address of the BGP monitor", + "wire": { + "jsonPath": "ipAddress", + "sdkField": "IpAddress", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_id", + "goField": "MonitorID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "BGP monitor ID", + "wire": { + "jsonPath": "monitorId", + "sdkField": "MonitorID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_name", + "goField": "MonitorName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Display name of the BGP monitor", + "wire": { + "jsonPath": "monitorName", + "sdkField": "MonitorName", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "monitor_type", + "goField": "MonitorType", + "type": { + "kind": "string", + "allowedValues": [ + "public", + "private" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Type of monitor", + "wire": { + "jsonPath": "monitorType", + "sdkField": "MonitorType", + "sdkGoType": "web_transaction_tests.MonitorType", + "flatten": { + "func": "convert.EnumToFramework" + }, + "skipExpand": true + } + }, + { + "name": "network", + "goField": "Network", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Name of the autonomous system in which the monitor is found", + "wire": { + "jsonPath": "network", + "sdkField": "Network", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of enabled BGP monitors.", + "wire": { + "jsonPath": "monitors", + "sdkField": "Monitors", + "sdkGoType": "[]web_transaction_tests.TestBgpMonitors", + "flatten": { + "func": "flattenTestsWebTransactionTestBGPMonitorses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "mtu_measurements", + "goField": "MTUMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set `true` to measure MTU sizes on network from agents to the target.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "mtuMeasurements", + "sdkField": "MtuMeasurements", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "network_measurements", + "goField": "NetworkMeasurements", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Enable or disable network measurements. Set to true to enable or false to disable network measurements.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\nComputed only on this endpoint: browser tests always network-measure, and the SDK's value-typed omitempty bool cannot express false anyway (local acceptance run, 2026-08-03).", + "wire": { + "jsonPath": "networkMeasurements", + "sdkField": "NetworkMeasurements", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "num_path_traces", + "goField": "NumPathTraces", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 10 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Number of path traces executed by the agent.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "numPathTraces", + "sdkField": "NumPathTraces", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "o_auth", + "goField": "OAuth", + "type": { + "kind": "single_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionOAuthModel", + "sdkType": "web_transaction_tests.OAuth", + "attrTypesVar": "testsWebTransactionOAuthAttrTypes", + "objectTypeVar": "testsWebTransactionOAuthObjectType", + "expandFunc": "expandTestsWebTransactionOAuth", + "flattenFunc": "flattenTestsWebTransactionOAuth", + "attributes": [ + { + "name": "auth_type", + "goField": "AuthType", + "type": { + "kind": "string", + "allowedValues": [ + "none", + "basic", + "ntlm" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP authentication type used for the OAuth request.", + "wire": { + "jsonPath": "authType", + "sdkField": "AuthType", + "sdkGoType": "web_transaction_tests.OAuthAuthType", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.OAuthAuthType" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "headers", + "goField": "Headers", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Request headers used for OAuth.", + "wire": { + "jsonPath": "headers", + "sdkField": "Headers", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth password", + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "post_body", + "goField": "PostBody", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Enter the OAuth body for the HTTP POST request in this field when using OAuth as the authentication mechanism. No special escaping is required. The value is saved only when `requestMethod` is set to `post`.", + "wire": { + "jsonPath": "postBody", + "sdkField": "PostBody", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "request_method", + "goField": "RequestMethod", + "type": { + "kind": "string", + "allowedValues": [ + "get", + "post" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "HTTP request method.", + "wire": { + "jsonPath": "requestMethod", + "sdkField": "RequestMethod", + "sdkGoType": "web_transaction_tests.RequestMethod", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.RequestMethod" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "test_url", + "goField": "TestURL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.", + "wire": { + "jsonPath": "testUrl", + "sdkField": "TestURL", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToEnum", + "typeArgs": [ + "web_transaction_tests.TestUrl" + ] + }, + "flatten": { + "func": "convert.EnumToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "OAuth username", + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + } + ] + } + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Use this only if you want to use OAuth as the authentication mechanism.", + "wire": { + "jsonPath": "oAuth", + "sdkField": "OAuth", + "sdkGoType": "*web_transaction_tests.OAuth", + "expand": { + "func": "expandTestsWebTransactionOAuth", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsWebTransactionOAuth", + "needsCtx": true, + "returnsError": true + } + }, + "drop": true + }, + { + "name": "override_agent_proxy", + "goField": "OverrideAgentProxy", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideAgentProxy", + "sdkField": "OverrideAgentProxy", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "override_proxy_id", + "goField": "OverrideProxyID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "ID of the proxy to be used if the default proxy is overridden.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "overrideProxyId", + "sdkField": "OverrideProxyId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "page_loading_strategy", + "goField": "PageLoadingStrategy", + "type": { + "kind": "string", + "allowedValues": [ + "normal", + "eager", + "none" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "* `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. \n* `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the \"interactive\" readiness state, before proceeding to the next action in the test script.\n* `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pageLoadingStrategy", + "sdkField": "PageLoadingStrategy", + "sdkGoType": "*models.Tests_API_TestPageLoadingStrategy", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPageLoadingStrategy" + ], + "extraArgs": [ + "models.ParseTests_API_TestPageLoadingStrategy" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "password", + "goField": "Password", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Password for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "password", + "sdkField": "Password", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "path_trace_mode", + "goField": "PathTraceMode", + "type": { + "kind": "string", + "allowedValues": [ + "classic", + "in-session" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Select `inSession` to perform the path trace within a TCP session.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "pathTraceMode", + "sdkField": "PathTraceMode", + "sdkGoType": "*models.Tests_API_TestPathTraceMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestPathTraceMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestPathTraceMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "probe_mode", + "goField": "ProbeMode", + "type": { + "kind": "string", + "allowedValues": [ + "auto", + "sack", + "syn" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Probe mode used by network test, only valid when the protocol is set to TCP.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "probeMode", + "sdkField": "ProbeMode", + "sdkGoType": "*models.Tests_API_TestProbeMode", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProbeMode" + ], + "extraArgs": [ + "models.ParseTests_API_TestProbeMode" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "protocol", + "goField": "Protocol", + "type": { + "kind": "string", + "allowedValues": [ + "tcp", + "icmp", + "udp" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Protocol used by dependent network tests (end-to-end, path trace, PMTUD).\n\n\nThe specification documents `udp`, which the API rejected.\n\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true, + "rejectedValues": [ + "udp" + ], + "valuesClosed": true + }, + "wire": { + "jsonPath": "protocol", + "sdkField": "Protocol", + "sdkGoType": "*models.Tests_API_TestProtocol", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestProtocol" + ], + "extraArgs": [ + "models.ParseTests_API_TestProtocol" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "randomized_start_time", + "goField": "RandomizedStartTime", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicates whether agents should randomize the start time in each test round.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "randomizedStartTime", + "sdkField": "RandomizedStartTime", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "saved_event", + "goField": "SavedEvent", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Indicates if the test is a saved event.\n\n**Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API.", + "wire": { + "jsonPath": "savedEvent", + "sdkField": "SavedEvent", + "sdkGoType": "*bool", + "flatten": { + "func": "convert.PtrBoolToFramework" + }, + "skipExpand": true + } + }, + { + "name": "shared_with_accounts", + "goField": "SharedWithAccounts", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestSharedAccountsModel", + "sdkType": "web_transaction_tests.TestSharedAccounts", + "attrTypesVar": "testsWebTransactionTestSharedAccountsAttrTypes", + "objectTypeVar": "testsWebTransactionTestSharedAccountsObjectType", + "expandFunc": "expandTestsWebTransactionTestSharedAccountses", + "flattenFunc": "flattenTestsWebTransactionTestSharedAccountses", + "attributes": [ + { + "name": "aid", + "goField": "AID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group ID.", + "wire": { + "jsonPath": "aid", + "sdkField": "AID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "name", + "goField": "Name", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Account group name.", + "wire": { + "jsonPath": "name", + "sdkField": "Name", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Contains list of account group IDs. Test is shared with the listed account groups (get `aid` from `/account-groups` endpoint)", + "wire": { + "jsonPath": "sharedWithAccounts", + "sdkField": "SharedWithAccounts", + "sdkGoType": "[]web_transaction_tests.TestSharedAccounts", + "flatten": { + "func": "flattenTestsWebTransactionTestSharedAccountses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "ssl_version", + "goField": "SSLVersion", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Reflects the verbose SSL protocol version used by a test.", + "wire": { + "jsonPath": "sslVersion", + "sdkField": "SslVersion", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "ssl_version_id", + "goField": "SSLVersionID", + "type": { + "kind": "string", + "allowedValues": [ + "0", + "3", + "4", + "5", + "6", + "7" + ] + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "SSL version options:\n\n* Use '0' for automatic selection.\n* Use '3' for SSLv3.\n* Use '4' for TLS v1.0.\n* Use '5' for TLS v1.1.\n* Use '6' for TLS v1.2.\n* Use '7' for TLS v1.3.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "sslVersionId", + "sdkField": "SslVersionId", + "sdkGoType": "*models.Tests_API_TestSslVersionId", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestSslVersionId" + ], + "extraArgs": [ + "models.ParseTests_API_TestSslVersionId" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + }, + { + "name": "subinterval", + "goField": "Subinterval", + "type": { + "kind": "int64", + "allowedValues": [ + "60", + "120", + "300", + "600", + "900", + "1200", + "1800", + "3600" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval.\n\nDocumented values: `60`, `120`, `300`, `600`, `900`, `1200`, `1800`, `3600`.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "subinterval", + "sdkField": "Subinterval", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "tags", + "goField": "Tags", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestTagsModel", + "sdkType": "web_transaction_tests.TestTags", + "attrTypesVar": "testsWebTransactionTestTagsAttrTypes", + "objectTypeVar": "testsWebTransactionTestTagsObjectType", + "expandFunc": "expandTestsWebTransactionTestTagses", + "flattenFunc": "flattenTestsWebTransactionTestTagses", + "attributes": [ + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Unique tag ID.", + "wire": { + "jsonPath": "id", + "sdkField": "ID", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "key", + "goField": "Key", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag key. For example, \"Location\" or \"Department\".", + "wire": { + "jsonPath": "key", + "sdkField": "Key", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "value", + "goField": "Value", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tag value. For example, \"San Francisco\" or \"Engineering\".", + "wire": { + "jsonPath": "value", + "sdkField": "Value", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + } + ] + } + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Tags assigned to the test. Returned only when `expand=tag` is specified. This field is not returned for Instant Tests. For more information, see `/tags`.", + "wire": { + "jsonPath": "tags", + "sdkField": "Tags", + "sdkGoType": "[]web_transaction_tests.TestTags", + "flatten": { + "func": "flattenTestsWebTransactionTestTagses", + "needsCtx": true, + "returnsError": true + }, + "skipExpand": true + }, + "drop": true + }, + { + "name": "target_time", + "goField": "TargetTime", + "type": { + "kind": "int64", + "constraints": { + "minimum": 1, + "maximum": 180 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Target completion time, in seconds. Defaults to 10. Cannot exceed the `timeLimit` value.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "targetTime", + "sdkField": "TargetTime", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "id", + "goField": "ID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed", + "markdownDescription": "Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", + "wire": { + "jsonPath": "testId", + "sdkField": "TestId", + "sdkGoType": "*string", + "flatten": { + "func": "convert.PtrStringToFramework" + }, + "skipExpand": true + } + }, + { + "name": "test_name", + "goField": "TestName", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "The name of the test. Test name must be unique.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "testName", + "sdkField": "TestName", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "time_limit", + "goField": "TimeLimit", + "type": { + "kind": "int64", + "constraints": { + "minimum": 5, + "maximum": 180 + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Time limit for transaction in seconds.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "timeLimit", + "sdkField": "TimeLimit", + "sdkGoType": "*int32", + "expand": { + "func": "convert.FrameworkInt64ToPtrInt32" + }, + "flatten": { + "func": "convert.PtrInt32ToFrameworkInt64" + } + } + }, + { + "name": "transaction_script", + "goField": "TransactionScript", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ ).", + "wire": { + "jsonPath": "transactionScript", + "sdkField": "TransactionScript", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "type", + "goField": "Type", + "type": { + "kind": "string", + "allowedValues": [ + "api", + "agent-to-agent", + "agent-to-server", + "bgp", + "http-server", + "page-load", + "web-transactions", + "ftp-server", + "dns-trace", + "dns-server", + "dnssec", + "sip-server", + "voice" + ] + }, + "computedOptionalRequired": "computed", + "markdownDescription": "This is a read only value, as test type is implicit in the test creation url.", + "wire": { + "jsonPath": "type", + "sdkField": "TypeEscaped", + "sdkGoType": "*models.Tests_API_TestType", + "flatten": { + "func": "convert.PtrStringerToFramework" + }, + "skipExpand": true + } + }, + { + "name": "url", + "goField": "URL", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Target for the test.\n\nThe test's target: the API refuses a create without it, whatever the specification marks.", + "behaviour": { + "requiredByApi": true + }, + "wire": { + "jsonPath": "url", + "sdkField": "Url", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "use_ntlm", + "goField": "UseNtlm", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "useNtlm", + "sdkField": "UseNtlm", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "use_public_bgp", + "goField": "UsePublicBGP", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "usePublicBgp", + "sdkField": "UsePublicBgp", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "user_agent", + "goField": "UserAgent", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "User-agent string to be provided during the test.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "userAgent", + "sdkField": "UserAgent", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "username", + "goField": "Username", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "Username for Basic/NTLM authentication.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "username", + "sdkField": "Username", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "vault_credentials", + "goField": "VaultCredentials", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "TestsWebTransactionTestVaultCredentialModel", + "sdkType": "models.Tests_API_TestVaultCredentialable", + "attrTypesVar": "testsWebTransactionTestVaultCredentialAttrTypes", + "objectTypeVar": "testsWebTransactionTestVaultCredentialObjectType", + "expandFunc": "expandTestsWebTransactionTestVaultCredentials", + "flattenFunc": "flattenTestsWebTransactionTestVaultCredentials", + "attributes": [ + { + "name": "secret_id", + "goField": "SecretID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "optional", + "markdownDescription": "UUID of the configured secret.", + "wire": { + "jsonPath": "secretId", + "sdkField": "SecretId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "flatten": { + "func": "convert.PtrStringToFramework" + } + } + }, + { + "name": "target", + "goField": "Target", + "type": { + "kind": "string", + "allowedValues": [ + "username", + "password", + "script" + ] + }, + "computedOptionalRequired": "optional", + "markdownDescription": "The target setting that the credential should be used for.", + "wire": { + "jsonPath": "target", + "sdkField": "Target", + "sdkGoType": "*models.Tests_API_TestVaultCredentialTarget", + "expand": { + "func": "convert.FrameworkToKiotaEnum", + "typeArgs": [ + "models.Tests_API_TestVaultCredentialTarget" + ], + "extraArgs": [ + "models.ParseTests_API_TestVaultCredentialTarget" + ], + "returnsError": true + }, + "flatten": { + "func": "convert.PtrStringerToFramework" + } + } + } + ], + "constructorExpr": "models.NewTests_API_TestVaultCredential()" + } + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "List of credential IDs that are stored in an external vault.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.", + "wire": { + "jsonPath": "vaultCredentials", + "sdkField": "VaultCredentials", + "sdkGoType": "[]models.Tests_API_TestVaultCredentialable", + "expand": { + "func": "expandTestsWebTransactionTestVaultCredentials", + "needsCtx": true, + "returnsError": true + }, + "flatten": { + "func": "flattenTestsWebTransactionTestVaultCredentials", + "needsCtx": true, + "returnsError": true + } + } + }, + { + "name": "verify_certificate", + "goField": "VerifyCertificate", + "type": { + "kind": "bool" + }, + "computedOptionalRequired": "computed_optional", + "markdownDescription": "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors.\n\nComputed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted.\n\n\nThe SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission.\n", + "behaviour": { + "zeroValueUnsendable": true + }, + "wire": { + "jsonPath": "verifyCertificate", + "sdkField": "VerifyCertificate", + "sdkGoType": "*bool", + "expand": { + "func": "convert.FrameworkToPtrBool" + }, + "flatten": { + "func": "convert.PtrBoolToFramework" + } + } + }, + { + "name": "agents", + "goField": "Agents", + "type": { + "kind": "set_nested", + "nestedObject": { + "goTypeName": "WebTransactionAgentModel", + "sdkType": "models.Tests_API_TestAgentRequestable", + "attrTypesVar": "webTransactionAgentAttrTypes", + "objectTypeVar": "webTransactionAgentObjectType", + "expandFunc": "expandWebTransactionAgents", + "flattenFunc": "", + "attributes": [ + { + "name": "agent_id", + "goField": "AgentID", + "type": { + "kind": "string" + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values.", + "wire": { + "jsonPath": "agentId", + "sdkField": "AgentId", + "sdkGoType": "*string", + "expand": { + "func": "convert.FrameworkToPtrString" + }, + "skipFlatten": true + } + } + ], + "constructorExpr": "models.NewTests_API_TestAgentRequest()" + } + }, + "computedOptionalRequired": "required", + "markdownDescription": "The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state.", + "wire": { + "jsonPath": "agents", + "sdkField": "Agents", + "sdkGoType": "[]models.Tests_API_TestAgentRequestable", + "expand": { + "func": "expandWebTransactionAgents", + "needsCtx": true, + "returnsError": true + }, + "skipFlatten": true + } + } + ], + "markdownDescription": "Get Web Transactions test." + }, + "binding": { + "service": { + "importPath": "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models", + "alias": "models", + "accessor": "r.client" + }, + "create": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "WebTransactions" + }, + { + "method": "Post", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_WebTransactionTestResponseable", + "httpMethod": "POST", + "pathTemplate": "/tests/web-transactions" + }, + "read": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "WebTransactions" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Get", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_WebTransactionTestResponseable", + "httpMethod": "GET", + "pathTemplate": "/tests/web-transactions/{testId}" + }, + "update": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "WebTransactions" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Put", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "body" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "resultError", + "resultType": "models.Tests_API_WebTransactionTestResponseable", + "httpMethod": "PUT", + "pathTemplate": "/tests/web-transactions/{testId}" + }, + "delete": { + "style": "fluent", + "chain": [ + { + "method": "Tests" + }, + { + "method": "WebTransactions" + }, + { + "method": "ByTestId", + "args": [ + { + "kind": "stateField", + "field": "ID" + } + ] + }, + { + "method": "Delete", + "args": [ + { + "kind": "ctx" + }, + { + "kind": "literal", + "expr": "nil" + } + ] + } + ], + "return": "error", + "httpMethod": "DELETE", + "pathTemplate": "/tests/web-transactions/{testId}" + }, + "id": { + "attribute": "id", + "goField": "ID", + "fromCreate": "created.GetTestId()", + "fromCreateIsPointer": true + }, + "body": { + "requestType": "models.Tests_API_WebTransactionTestRequest", + "responseType": "models.Tests_API_WebTransactionTestResponseable", + "constructorExpr": "models.NewTests_API_WebTransactionTestRequest()", + "accessStyle": "method" + } + }, + "policy": { + "updateStyle": "putFull", + "delete": { + "notFoundIsSuccess": true + } + }, + "import": { + "style": "passthroughId", + "attribute": "id" + }, + "sweep": { + "nameField": "testName" + }, + "accFixture": { + "values": [ + { + "attr": "agents", + "hcl": "[{ agent_id = \"3\" }]" + }, + { + "attr": "url", + "hcl": "\"https://www.example.com\"" + }, + { + "attr": "interval", + "hcl": "3600" + }, + { + "attr": "fixed_packet_rate", + "hcl": "50" + }, + { + "attr": "bandwidth_measurements", + "hcl": "false" + }, + { + "attr": "desired_status_code", + "hcl": "\"200\"" + }, + { + "attr": "dns_override", + "hcl": "\"8.8.8.8\"" + }, + { + "attr": "num_path_traces", + "hcl": "3" + }, + { + "attr": "browser_language", + "hcl": "\"en-US\"" + }, + { + "attr": "user_agent", + "hcl": "\"tfacc (ThousandEyes Agent)\"" + }, + { + "attr": "randomized_start_time", + "hcl": "false" + }, + { + "attr": "chrome_options", + "hcl": "\"--disable-gpu\"" + }, + { + "attr": "collect_proxy_network_data", + "hcl": "false" + }, + { + "attr": "use_ntlm", + "hcl": "false" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/pilot/thousandeyes-kiota/.tfpfgen/manifest.json b/pilot/thousandeyes-kiota/.tfpfgen/manifest.json index 41bc8f64..33e5dd5d 100644 --- a/pilot/thousandeyes-kiota/.tfpfgen/manifest.json +++ b/pilot/thousandeyes-kiota/.tfpfgen/manifest.json @@ -4,497 +4,1052 @@ "files": [ { "path": "internal/provider/actions.go", - "sha256": "48f0a3a4afee8b9c8c996be08c667d1048fad5a28a763a3253f82115a35ee14e", + "sha256": "ed5734a3def489737ceb16ca937ea3317e71165fbcf6429ea09e2fa13b6269f3", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/provider/datasources.go", - "sha256": "564d5bec6f34f3d8f30d200ba811a408d3d8d4b1575852edc6cceb524ca74d77", + "sha256": "bfc66f8bcc751703f46c20e0f85088688b58322b9963c11f7a726749f88b74ec", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/provider/ephemerals.go", - "sha256": "44c4ac85cee622431119ca567e26831adf8b6f022614a53afdc5c5f7abd6b07b", + "sha256": "18bb60c8109908864b51579a51dc924b9186d607072f8ceef600044c9ddf0691", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/provider/list_resources.go", - "sha256": "f460cd16e701d2097ce79f8bcf68224a435d77af1f6cce7e4aa7a0d5786b5e63", + "sha256": "ed44b22362bf685af426485f8a8d6852c7a407b6ba96da1a0d2acaf184fe72da", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/provider/resources.go", - "sha256": "5f0aeffe9c99c96289853b2f1de63cd9ecde596771c961d806692458b4f88126", + "sha256": "99167d66302c5af85b07bd5349b127f16e47b8c0c9731a8dcd512cfcf59d5f8f", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action.go", - "sha256": "6c50f4738d724d2948324946c0eaebc7c89b2a67243db6c65760af15bd8b2907", + "sha256": "7db23ea8aceb007a3e18094403744d07d74827fb2bac560d15ccd92fe80bbc39", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action_acceptance_test.go", - "sha256": "9314b17dadd7c6826c8a0d31bea51bbe1281f907f697a31e749719a6d27dac29", + "sha256": "ba4e50fd8750f713a41e967c6bb498352a8703b1579450afb7a149958cfedc73", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/invoke.go", - "sha256": "b093489343fb4d1be874627e8582da580be5ea9388ba283efcfbd896c8b3621f", + "sha256": "544a9cffeb2d7d9a3ccf7e0a07117022e203c23d30cc44acb37f878ccf8eef69", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/model.go", - "sha256": "a271cd5994fac38593131634c5c806da65d8ee500311cb1e513ae20786ab405e", + "sha256": "de9d0bbe2fb7985f97ec8d01f994f2a20411a40460a879f349bcbe400e21054d", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/testdata/action.tf", - "sha256": "09e3da54b1aa0346e388974abd4a8972098d49f8f5717a5374958219b34d3944", + "sha256": "1d34a701c25d513afda532d7ae92af43092f64f9a443995f5016ae37d491a3b5", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/datasource.go", - "sha256": "559f412790a5f71be76e6db6f2f064a46822f01bb44e01886bcc1b94aae3d1fe", + "sha256": "5c31d08c165b95c9fa455bd1469322977cfc3beac058019265c10dd33fb3db86", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/datasource_acceptance_test.go", - "sha256": "d3438b5d18f1067b019fa19df9a43d1600a6b2db92be79b6cc63ec9cc9122a1d", + "sha256": "465528cc7106c9bd4ce215a1944364a098934ca183315cf8b0141a5d18ef87f6", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/model.go", - "sha256": "a4afddba7123a78ad7077d5a13cab62b2212e0a90564533b7b18efdf5d6e54a8", + "sha256": "6e1c0c663cab0f760361c1996320766386c27b2e51786cc605e789e6a2e994a8", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/read.go", - "sha256": "7bad8c0c71b8f6bc4fa52e7bd028fd5417e2e807c48c79b8ce64aa6245ca07ee", + "sha256": "eeda36a04d96c6f259c889aec7c62891c94348de7d8282360b4dad1a3ab7c827", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/seed_helper_test.go", - "sha256": "7bc93299a17689930110f723388e6c5e27f5394edd1b21e437d6148d2c317c64", + "sha256": "716b4f20abddd91d9e4a7efdd9bce9f0fbf90ca21d9c08c970f241627cfda6d0", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/state.go", - "sha256": "0b9f430d7b1b5653afe25dbae9eb6edceff16af27dd14ccab0c2ddee591b6703", + "sha256": "2f352557602c342044e26647ad5e18ed71d1b62a0ff426aa9ca342ac80b50380", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tag/testdata/datasource.tf", - "sha256": "80c5dadfbc9854c9b6077235b6ab70670cec122caf1161bf6b56899fe415914f", + "sha256": "a3947ddffefa18fb9f91685958276cfff88dd7474fb898aef41cba931367916a", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/datasource.go", - "sha256": "1730e0d8df73bf2873e142e282c11d16e1b0c0de458ec902466a73689989bfe1", + "sha256": "32495b222e14fe08d5809e0dbde40ca730760810d3769a7536df39186be1436d", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/datasource_acceptance_test.go", - "sha256": "72f89a467638ef2c168688924a9f52acc7f2a904744fabb6438a03c33b326c05", + "sha256": "d04a9166653226fd9206b5625b740b5b1d90918e88a4294032e9880cb4aecfad", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/model.go", - "sha256": "3a5c6644dfbd2ee3954d3df643c1f35c774da1690a3c5278f96a67e1954130dc", + "sha256": "4c511325d7b052ea47385894df2bfa058b2c015847cee1856949340b0feef736", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/read.go", - "sha256": "1f2e083b4f57b44ec7ebc072e95fa73b4e07b80b07a75132f1fcb8ee09e3eb85", + "sha256": "36810ae2822d1090e80352bf62850cbf83dfc2ba66614337e2e0b41fa8c1ff5c", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/seed_helper_test.go", - "sha256": "ef6af9f46dda45e9e01b4f372119f7cedb4d384d8ad5a47397065cfd0640a6c4", + "sha256": "0a1d76b9496128c16232a6a22420b8a95f833c9406870a9cc92c53469d487283", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/state.go", - "sha256": "57a045582bdc6a56608e1347da9aa0039e3766e1aad4e62901aeeaf66ca7913a", + "sha256": "9a2317a04c7a719815aa490ac9827dc2ffffe92459ad4e387f00b4105631bd15", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/datasources/tags/v7/tags/testdata/datasource.tf", - "sha256": "4e0d00e8c4198d92afaffe8753416f440e91ac2fc77899548b74abc1b68dd419", + "sha256": "1c9d7fbf2406cebf6429a4f8f61674e28b400a344ff547a0eed055b7990ea14b", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/ephemeral.go", - "sha256": "41b6042249b4ae5bd75839c6b2c994588519b547bf160ac700a233d438f26090", + "sha256": "baa7e1319b18070f388546f67a3829ac868fdebc21443e61dffc03d8195143af", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/ephemeral_acceptance_test.go", - "sha256": "3b3f5f5c9307c100a17d81956f16a36931379c79c77a347db6db8c91da5e2058", + "sha256": "36d05eed4fc7004d16844908879a62a2ca378de1ffc56cebb3a7ed6e16e43be7", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/model.go", - "sha256": "062559b160f788e8611590f988d5275f64cb222552aa2a729897e385b50691ec", + "sha256": "6265c944e9cb5ae296922880c44c9e17e59cb77ad243d42a0ef6606da89c4a45", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/open.go", - "sha256": "4c1c018921c83e6ac1137c250d370ad256d76b264297cf016463ffd174b6ab39", + "sha256": "0c9596eecfbec10a0f92dc20f25b01609d4a41afeb92729c317e4d2dcda6f8e2", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/seed_helper_test.go", - "sha256": "75e962b348dc64adfc9916ac56bb2cbf15ab4342852aa3a178d1d1a9851c919a", + "sha256": "003e6ea2894010da34cb7b52cb855e0c10baee2916131948ef4848cf95ab11d7", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/state.go", - "sha256": "4d46efa0413b40d987f3f843e8ee504c3169266e2266324f06bb64ace709fb65", + "sha256": "bcd963440905f2ad117b20713828213ee761cd483e5cf4dcc341f76fafc7e3df", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/ephemerals/credentials/v7/credential/testdata/ephemeral.tf", - "sha256": "967df85d5638724d66d32e478f2077daa1b9aa8d555b6b375d2d64baefd40a85", + "sha256": "5cfa73c61cf154fe2e2343be413cf2bf619c05220439359ba09f179af4ef76b5", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/construct.go", - "sha256": "520381704d373cd8e16132085a36b8f5ce669e97c532be6e02e481e0d6caf36b", + "sha256": "53341b43e155ce6317b0c658da07d47850df0d8a5956f79c25cbca3ab76ec538", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/crud.go", - "sha256": "1db3d1fbcdaa945d46687457b400557bb27605babb95e91be394c0f7ec46cc71", + "sha256": "49106634a30814d4e0bdaa6aec948323ee48c95582fc9c1c87c7a00a70941745", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/model.go", - "sha256": "ceecaea0207d977805f87eb5f7dc229fe8f89874e42a67b3f71cd1a64736468b", + "sha256": "171c40b48538a3389e066a937a12670022635ff3619a321436a7fac0dbe9fa98", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/resource.go", - "sha256": "3ad98525a51c373fada54390d995cbbf31107761f8aceca4267dfe1dd70080ab", + "sha256": "7eebb31e17c562fd3ccbd7cb1a9c4965206af8002102f72b44a1ce230e7fa9c7", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/resource_acceptance_test.go", - "sha256": "1f3b191fff2c87bd6901cd06fc8305cb1472fa22ee4cacbc27eacb2895f7bab7", + "sha256": "0fd2ab909474f574cf6e5d758b289140d438ecb6c0f006d8fa07027c8e136c85", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/state.go", - "sha256": "e34f9b39dd24fa23a23cd6b7b267fb3195a0d5c764b189ce816ba91812322928", + "sha256": "2006568e1fff5c54b55eeae1813253948213252c3fc1f4fcddc8d093790e1697", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/test_helper_test.go", - "sha256": "a8fc8c48d95a138b54e219c2b02535e023bc3c1307b88a45f9b09092518c291b", + "sha256": "a9b1b5c32714e2fb86b2ba48dc8e19e2de50bde37402e1c5c4ecc9ece5e935de", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/testdata/maximal.tf", - "sha256": "49b0322ce7f4bc0aadc3ccc3f9b3dea66316ab26dcdc6b9836bb5c67489fec25", + "sha256": "4f89d00e8b9365df77a32887edfa916e507eb7dcc7b4aa48944f984776e1732d", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/account_groups/v7/account_group/testdata/minimal.tf", - "sha256": "c114e4d23054d59d025085c1aff280a6ddd1863b656757638947b4f0ff68b4d8", + "sha256": "384faea000a043899aa33563f05b8e07775f21425d7496f449bf4d85fb5de8bc", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/construct.go", + "sha256": "396a73cfb09e920674a7f872aa3ff36f73b16e4e3570d5ab436eb6d6571f6558", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/crud.go", + "sha256": "bc3db5700808144ee929db0248a597d7f170cf87d0093d2e481bf4f35fee8a38", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/model.go", + "sha256": "745680e14c5b82a9da0b5f2cbe1a6045e189c1ac35fc6208b5e86502df441609", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/resource.go", + "sha256": "0fe41e55d8ed2a52f8ca831f1b79162996d69d8629ae8edbc4754e0a81c297bd", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/state.go", + "sha256": "afcbf75885d947fd6af874fb8280716a229161371e0ada58c121c1318d10524a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/test_helper_test.go", + "sha256": "b01b93ad38351e3667cc0c420c373b3bdfa126a3c3af3d0d118c0f4766e7dc38", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/construct.go", + "sha256": "74b32fc6d0ffbcdeb73b104668deaf8d989e8219fbccfde7537e81a3adfb41ae", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/crud.go", + "sha256": "cd9c649713e61eb825a9b182ca9e1d5355c92eed24723e75361aca56446a5482", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/model.go", + "sha256": "09e8d40a1cfa3d5970c9ac99cf46491da7627e44a263e083e8bbeb0268adf2a9", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource.go", + "sha256": "4f86376193383e6519260101833575348f631b0207ac8d2d438fcdba9b8edbbb", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource_acceptance_test.go", + "sha256": "7423bf9b3536a4cb7ed5ec2acf99bf819779eff300e3e4186f0ebf4fd82fe03e", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/state.go", + "sha256": "ca801b2ad2bdb205ad9fe8c681399a68f89efdd39e8e3458ac2ce2046848cede", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/test_helper_test.go", + "sha256": "cc1210b805c544af26269db871e6c9ba38efe442f541bec6dbb21de0a85b0833", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/maximal.tf", + "sha256": "120a7f946405d1b5a8c78e345fcaf6144821bd62ff1d8e60ee165fe939c63623", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/minimal.tf", + "sha256": "0d51572c0d09f493a4e2c1e31d74bc8495addd7172257e5b1c85de515380df3f", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/construct.go", - "sha256": "de01856dc0b46ad2dbeedde1de409a7c30abf49447b7e098a127eae7efff76f4", + "sha256": "da7b4688aa11c6c13651398d115bd5e5993360b128b5be8c0552bf803094095a", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/crud.go", - "sha256": "3572e331236c0d1fae8686a364ba3a74418d568dd092cc2742304b480ce8d211", + "sha256": "5d166b4d1e8a34eb382dc900af9739c246f454db1f816f7018d99fa73d5238c6", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/model.go", - "sha256": "e6e8f61ac1306eb0e80a07805377a56e0195ef8cdcb6df8678e1f3fdd3103942", + "sha256": "e3a0ecca73b45f9b1ffe1238282fb6973a6ee2132afea47a8678554569232201", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource.go", - "sha256": "c9f1273379ecdd7484c5ee3742c63b1cb160b6c413531944a05ef1b869cc6ea0", + "sha256": "0e4111e9e06d8b9e09e7378cfe90f6ad93d947271690426ea3114de75a6fb281", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource_acceptance_test.go", - "sha256": "6f6c535d7d4dedc433a2ad393d6f21308b110510fbe34720dba1773cf2fb66f3", + "sha256": "6fdff2fc9eabd32cc02f610327cfbfd8097e8aff9a631e3a4170a5c52c147abf", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/state.go", - "sha256": "167d76b3a0c37f791c49e0929620daca06b6d098470c71399419a69cd04f057f", + "sha256": "b98a33df88a9a72ee7c1d6091d83551c543a06e9d90a2624f495dccc2823463e", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/test_helper_test.go", - "sha256": "60631190159c667e8a0e4ddc58f44913591bbbbac9dd156c24d2f7a98782c260", + "sha256": "d4defee2cd36d17ca85c7f2b3e0b6b0fcdd13fed4a5dedf4692f78e0513d3e42", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/maximal.tf", - "sha256": "4fe397e59f230581b4fdffe5dbde972b2098531f3683355843974ac930c1e849", + "sha256": "75289f2a60055db4c5e8cd38a321e77a77d31cdb74f0c9ae7f5b3500d88733e7", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/minimal.tf", - "sha256": "bc3f280f1820ffed201c6bd7f92380a25bb026bb3b1e40e2739a7a5fb3ff8985", + "sha256": "f0d391ba0d34146e102c82ac0db059932da52cd4779de29491cd25a67ba2b47f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/construct.go", + "sha256": "46c75cd7359117c73aaef46016252efe5ecaeee2dd87e8fe3ae3433464cc805d", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/crud.go", + "sha256": "c40a02a3bef6f4f96e4d282a4984f8c07831d0f0363ea7962131305c34373205", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/model.go", + "sha256": "c14af200ab73d16fce6eee2e61bb9e566d5e9cd2076ee84285db7a904088bb9a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/resource.go", + "sha256": "dcaf8e1f6886cf776bc86d0425faaf46ccc4590a769d748c25ecf0368ea8de9d", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/resource_acceptance_test.go", + "sha256": "219b5a9d0266962fedfbb7e2cc31499e81e33505df4d4fa64537fe01a8848542", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/state.go", + "sha256": "645fd0ae2782873432de802be0fdeb0bc51ad63170c4077fb34d61d1b527a42f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/test_helper_test.go", + "sha256": "d408572fee042badea21720a69e22ed42cc52e130c5c94232c4d1c89eb5bf534", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/testdata/maximal.tf", + "sha256": "2201f69a29917cd70a211e6bd35ca95a0313dfd395fd5752b9faeecb283fb869", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/api_tests/v7/tests_api/testdata/minimal.tf", + "sha256": "47699b4298a20d6eb561917d9ec1e3b70f2a1ff23dc29429c48deb69bcf42256", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/construct.go", + "sha256": "79d4eab4df1bcfe4a6436d4227093c3fcc3d141da7dadf1d5820c5d66e58aab2", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/crud.go", + "sha256": "8b87ea39a1993ed6759c24555bdb2fc0f17389e7a4e9c9706b3f69fd23153599", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/model.go", + "sha256": "860c2b8751fd9fd77068f5129e3bc44756f5d16cbf545a7d80d3fa236c952dfe", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/resource.go", + "sha256": "3f21b4a7ae92dd5594805828459c38d2ed4083e3722dfeade5ca50d8db6cf1b3", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/resource_acceptance_test.go", + "sha256": "88c772d3d490625358a40999f139a01cbfc2d596933d8765e12b73e73c2ecf4a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/state.go", + "sha256": "618a6c9d3fd6e77f78261cc1f191581a32eb74788a2c4921ad608c57ac917636", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/test_helper_test.go", + "sha256": "640e5a2eb3f82eb2de1d6fe730efbfd734643b1128d70f96429ba020c7231619", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/testdata/maximal.tf", + "sha256": "d834c65e9edd4e82db82ab37cabcd0633a21bedc776792b0d7bb4d5a36b562c4", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/bgp_tests/v7/tests_bgp/testdata/minimal.tf", + "sha256": "1dd3f6fbb12594a263562c6935268ec66898bbf2cdae30b90caad2f72c7d90db", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/construct.go", - "sha256": "3f0b727262b60193b626338ff28f00207266a1ee5ca9a6627746f0ffd2dfd777", + "sha256": "0419a208f305844377b78d0e5d1037349915b7887b8cd67f85b7c262c65983a8", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/crud.go", - "sha256": "7ad2a7c25d39e41a0abf798137e723b53fdc0638a6c57dea13c9a26008d9e9de", + "sha256": "c57e47f28cac8bf8d2ae5ad5935cc05bb1b62e3c5581af8b8ef4b92630659117", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/model.go", - "sha256": "96d956a635eec953369594a0d0694a4d16d8bb24bb87b09fdf6c3f70ee691cee", + "sha256": "c14a35f99502983e8e610a6d3c8672ca10bc44150f5afd379ab0c0e2f2241d8e", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/resource.go", - "sha256": "4c17bd77a1b79996cd85b53ec1d87c8bf72bb8783bd66a0d563e240ecad8cabe", + "sha256": "872fd7354491619d48c65760f7080c1cf23804623f0ff150dd61a58b69c8ffdd", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/resource_acceptance_test.go", - "sha256": "eaa9c090541b856365175c5bdce74baa3345083aa44ada26de3c12ac623bbe4f", + "sha256": "36b7660f59d1c76c4161eddb6223c9c3ae1153cf33921113bdd53117349ffd7d", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/state.go", - "sha256": "38e495538c707e4d35d278ca5db2b1a98bfab617a809bb52c64f354f534c8762", + "sha256": "8bc1c01bfd80a3124dfd4abbdbe2b9c8ebdf26726e0366a37640280c3fc1ae8b", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/test_helper_test.go", - "sha256": "75e962b348dc64adfc9916ac56bb2cbf15ab4342852aa3a178d1d1a9851c919a", + "sha256": "003e6ea2894010da34cb7b52cb855e0c10baee2916131948ef4848cf95ab11d7", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/testdata/maximal.tf", - "sha256": "9f4862401757a930b966ce272d2ed6d5ad14b73e282a50102c11113ad3d95648", + "sha256": "ba4f901f455ff415f80982af95009bbb4e03d8d50330e67d28fd79ea8e78de70", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/credentials/v7/credential/testdata/minimal.tf", - "sha256": "f484daabf67df64a338e11177b66a51bbca5ff1054417ed0408dc3ee37ea655a", + "sha256": "05b9b2485d3ca5a49261eba4a510e969cce901ea08e9d2db926d70e0d363d1a4", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/construct.go", + "sha256": "35c240499be0b3ea5c30076965c79c2aa09778fcbe4fc9d19f97b969a4afc62a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/crud.go", + "sha256": "9f3c6c8c4fcc27e9db97f79518d294bcfe8cfe183165a6eca3618de285f9f2ba", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/model.go", + "sha256": "00bc43f48697b20eacca95cefad5a4b8d099524448d4e3faccd54c11d1d0b8d3", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/resource.go", + "sha256": "04d4ec5c918263a26d9d3eccacac9bb35bd26bedc3bd0611c26dc810ef70a2a9", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/resource_acceptance_test.go", + "sha256": "bcc4fc0751a05390d92e52d81f80f921af1969ec509c7f7c489d00700b5314f0", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/state.go", + "sha256": "1fca03f02cf1ed6c4dfb30074de0591a1653055ab655cb28076f82dd351f0f3c", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/test_helper_test.go", + "sha256": "b574ab4043fe2e663ae347160328c036404cbf33d88a3722ff0da683b58f47c7", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/maximal.tf", + "sha256": "cddf39a9c428b633856650f59c1ddf1d40944e9d8f25a5f434c69cdefc80a6ff", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/minimal.tf", + "sha256": "28abdcdee057a8a0a06a17975b3dc835a4c6efcc612e5885abd29c53683b75c7", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/construct.go", + "sha256": "d5b4fcdfb26eb1e640d2493d9085fd241995cc18c773d62927043b540f9c15c9", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/crud.go", + "sha256": "cdba8121deed26025cf4262aef0c88061b22e4ffa82417e0f268f9ddad0b16f8", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/model.go", + "sha256": "bb897d05d133cb0cf7d4d5adb051fdfb87cb5a461047fcc558598b8f0d9683fc", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource.go", + "sha256": "04017a6b464339e9c7754007d6fdd768ee0fe4054cfa071b7264413dc97ab845", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource_acceptance_test.go", + "sha256": "233102fe88a71ffdc7a3f02499f8c62a0b58bcabb86e83d98205cca508de0ea8", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/state.go", + "sha256": "7d0de1e68800e08edd2f825b81b144ac5ae245ec422a62ec909d853da0f49636", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/test_helper_test.go", + "sha256": "d832c165842e49e40aa01c3ef08db2adef1a1d67da39756c5fbc3a941d73495b", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/maximal.tf", + "sha256": "0b83b8acfd435c21590295e2e5ad8140da0fcc8f6358b234954f7683f1d84f95", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/minimal.tf", + "sha256": "2410646e195b118e1c960c7963b894a589ffe6e6e90d086209fa81bde79c3d2b", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/construct.go", + "sha256": "d291095a25c676d85340103c537017fe8753be89ab8ed6d1093552171ed17469", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/crud.go", + "sha256": "fe50e1ea57143c6a5a07ed74456c80c2b961bc5a47dc63b5f168caaa1fe1d9bb", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/model.go", + "sha256": "4022002c27a7248c67a1d345c03ccb4b290203a8ad69298fc48f2c9f05a8e2af", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/resource.go", + "sha256": "4a001af1d0d25857c4ff934ca5de5b239b409dc1d6c8022dfdd0b91b034b91ca", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/resource_acceptance_test.go", + "sha256": "2b19d5e3e00f1bd33d8e9749780f2a60e025fdddd77379c827367619de3ee6d5", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/state.go", + "sha256": "15ccceed81aa29e8aee11427d725a1858660941d1af24747d3898615cdf5b71b", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/test_helper_test.go", + "sha256": "91d0e972ccda0ad4a9d72571b5b2fb30f5661a5ce3cb59a5d2674ca00c42faec", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/maximal.tf", + "sha256": "aa750b98f6223a47df90ecd945b96f5e2ec98a94588336dc8a18c8ef328531bb", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/minimal.tf", + "sha256": "efa4057030c73bb7c5c330ad39ce9653f82f92cd13443a8eb05dd5d10a24bae6", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/construct.go", - "sha256": "72ddb250ce2b750e88bbdc626d143eb9007aca408f9e6c4072ddfd1312576cd5", + "sha256": "a329dff774c853ca4af4347dae807ead8b296cd916fd1e2a0cc5df3c21c84264", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/crud.go", - "sha256": "f98ba6f91aa024a84698d0b7136a2967d5ccdce49dd4cca9f7e6d7b23403308b", + "sha256": "62e2e934b162a4f110ac4e1cc1d8fd6444216135d3246e5d0a09d6da71bc89ce", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/model.go", - "sha256": "35fda58b8879b6178ccffe8cd9e2c28b71b6dab2a6c702dd1107ef4a3b6ca540", + "sha256": "176380aefb3f694c25604d0cf7e5ec2776e2f6bbaefc2bab73f0b6918205802d", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource.go", - "sha256": "dfd553b64603c423a81e3094debab2549f0e0b87b2085dcb52fe206063f8a6e8", + "sha256": "fb7520a4d377892ac8cb1bc246baac2381862e62935e984b960b075db123e621", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource_acceptance_test.go", - "sha256": "90d071d9dd1180b4be3b35248ed4d27e2260187b7bdc6358c65160b202360cb5", + "sha256": "c90ffd15c6455d05c057e7667953c81cb7e9f3e3c925dabb264dc32d118fed74", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/state.go", - "sha256": "f80d3b646f94255212c3148231379aaa56bc115b053b8b67364e53657f74aa2a", + "sha256": "5eb4705518246b7334d7754c76960ae3e170153f4688e28edd92976dc53f8ccb", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/test_helper_test.go", - "sha256": "b9ec3cf10f888641ed18db30c4244e6f813453ded34683e1d11cd52076eb7a4d", + "sha256": "f6c2bd0d818e24ade24e8bb77de6ef6786b5415b9c17e1b3897e21e036a0eb11", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/maximal.tf", - "sha256": "c17724d4ba3091f4d530cca0e5768dccf8420b418d83f123064a78ad9ee4d529", + "sha256": "79ec136647d23607ed827e3aacf0ef8f4aec50f2585939cec065bcb457185ebc", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/minimal.tf", - "sha256": "0207fbe18da13e4efe3ee476be1144a8c635c3cf7fd514ff1118b43fcb074e5e", + "sha256": "64f8769c86f3562dfdb63abc65aa7092ddbecbcb95bcc11be6ae1e716bd15b44", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/construct.go", + "sha256": "6adcec218374cbea05e1b18061f0d7a74e1cf9ac23c7a026bfbb90564941f71c", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/crud.go", + "sha256": "08c7ab11ebe9d4dc658f1c4000af45c38af8cbee3ef777f1541dc716dc5b0d68", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/model.go", + "sha256": "8e83fbd6d2f858a7028c750758cef68e76e72d7a13ee6a47e87ec8c6e94824da", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource.go", + "sha256": "b1b4c75315ef0b499b26eddfca4841d572d673d416930202dec707ad907e7d7f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource_acceptance_test.go", + "sha256": "33dabba8103a6de57618bea1fe4febbe12a5ba95bd78f0009368eafa836aad9b", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/state.go", + "sha256": "97c08c636213ebb0cb354b25ecb28b744856f94f178c971ab1b36fe43a9eeaaf", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/test_helper_test.go", + "sha256": "9db59af72c8bd22328d15b0d9c49a952881410c06a8e95f1277ed185758dfe8f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/maximal.tf", + "sha256": "5598929242fcd8d4b42d640cfcbd6aa4910b568ec4a3fd73a7e6e92dbe383288", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/minimal.tf", + "sha256": "5de368e552b014b4970ae57556e88c3a263c8753d49817e7ca82a98a8baf2c43", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/construct.go", + "sha256": "cbc987a890cf32372084519ca206007de7d3ceaf38eb6d3637bacfd68a616087", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/crud.go", + "sha256": "ef28db6ac17e583d7e0e7e8d114bcb829678cd128c97af45ac2e6e5d68720f60", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/model.go", + "sha256": "5f78d90e46e6a07b023919d1a197140c93fa235e6f329dd281f3c19a3315466e", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/resource.go", + "sha256": "ce4839006e75dc3251958faf0842cbc7241b392252a4413a54345f4bf6b51f41", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/resource_acceptance_test.go", + "sha256": "5136cfc7baeb5b0ad3520be3ad4690c55beeceeae4efa21718aaeecffa022169", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/state.go", + "sha256": "d91b6ec46959b62ae1bfb319e85ef44b76ba319d52c12026f2d5bf82790500df", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/test_helper_test.go", + "sha256": "36158077d88db7c71860e184145defb39b7c8f83a0d4708962968e340eabbf5b", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/testdata/maximal.tf", + "sha256": "f97da7fe76ea2a191777e590f53351587d0191ac3da3f7340a950dfc0b0aa820", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/http_server_tests/v7/tests_http_server/testdata/minimal.tf", + "sha256": "af2229fb83ef0f91ac927b3464e3341d1fe5683b63a826b6683b49a95d65fccb", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/construct.go", + "sha256": "a0637dc79649fa141e7be9a953567c762dbbe3c3f8e0fbfcf09e4da0505ec5d7", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/crud.go", + "sha256": "ffce61187c216900344b40f9d257c713c0ce76bea8904fe24b95b7e047cd025e", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/model.go", + "sha256": "53353f778fd6122a65dde3bad5706ada27a83a888da15c85deea39ecd10e2698", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/resource.go", + "sha256": "8f7c998d085f02a65c8d799caae12128323b2c8ce0110add45a73d6ee47e2a1d", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/resource_acceptance_test.go", + "sha256": "5fbbeff6b815e982cd9caf64101c84d82d2406a76cbcefa0c56aa725f689069c", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/state.go", + "sha256": "de03db063d7a86480c86aa85e5e83cceaf9ab21aafaf2a6194f6fd9d0dd53268", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/test_helper_test.go", + "sha256": "652c0a9a28899007361cc55641f15c0e4f653ef07c292e3439a11c2506ca5c7f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/testdata/maximal.tf", + "sha256": "4670f245e89c9ba1510d4c1841883f71c07d5c56b11b443815c6cce20899e214", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/page_load_tests/v7/tests_page_load/testdata/minimal.tf", + "sha256": "25145f5fea8e8a4a94f44afb4d020214684f6df34ef2a8fcc74e6d6153bb9c50", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/construct.go", - "sha256": "ab7e602646b30d0e431da4155e59052e7be6110616607f1b7c628ea1cb7ca6a7", + "sha256": "8651e3e050e7e13b1dbf326aee97f0770416334939bf8adb20c260bf65d22d70", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/crud.go", - "sha256": "e73ce4b33061369c5df0390ecf97d687aa06593d3e7a6639cb9b8148ee005026", + "sha256": "a9aa03c6d741b2b4368495c056a76f93ece2ed9b12a8a99711ce207f7bb5ce52", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/model.go", - "sha256": "e1f81a7c28713fe985406d9156a167616fe3df3ab8a7ea53810341b4d2c142dd", + "sha256": "c8a68f1e871ac4225ea63af3d3b10f7e0c5aa2feea6cd118bdef5ae8767bb19f", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/resource.go", - "sha256": "2a1276ffb65da760769feb2bf43d00a8d94021338c27fba36cc1ef23f809856d", + "sha256": "3245f838d74b2ab2166ab837e3da19ee0d9a5c9215c9b5468e89eea0e9e7aba6", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/resource_acceptance_test.go", - "sha256": "f14bbdf416d2441cb436d413a3ccb71d253944dfd2e2a9f465954a84677a2b6c", + "sha256": "2af837ca3e292b8028e351b32ea7efed2401bfe29056e0a4e7c595d44e1aad62", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/state.go", - "sha256": "c63dac8e2658e42d5cf426c678b8d5a7dee16156ec2cef739828e8c2136f7acc", + "sha256": "f630a6f0fea885b1575e89fd904d09cf2f30918e3e8ef91d6984fe68e60db743", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/test_helper_test.go", - "sha256": "ca4b3ee782c7932926e604719100c1f6bf2277980de20203abd903de60983d87", + "sha256": "cee74f2f8f1fabb4e563ca50980bcbbbd58a562bbe4d1f57f57e0ab383d4a218", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/testdata/maximal.tf", - "sha256": "dc4c205a0e3f14df79ef54741bd862fa0dc964db7f48e48364e77d5836e5ffd1", + "sha256": "4216575ae4ea31477a837547850af733dd08ebe8fa8211b6aff4aa38eaef99d6", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/roles/v7/role/testdata/minimal.tf", - "sha256": "d5d95dee9a37a85149d28d30599023e87359ef87b2bf6082f33abee2fb4876ca", + "sha256": "734c70441646e8588519a99c433ab564e066145b42cdc2a25f8361603de8ffdd", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/construct.go", + "sha256": "c652d28febcc927d0deca65abcac03f4e0be9aba0f8247455c190f2adf473681", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/crud.go", + "sha256": "089283e0772bb7bc127cfcaad6c10a24718fdf6972eaa44d08fcdb1c4e10876a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/model.go", + "sha256": "6001de40438207f197698b5a2e6bc74966a417ee16ab9d7c585f8f4c6da0e2be", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/resource.go", + "sha256": "b7b2892e1a83bf784dc935ad0e27c39e2101bbeda8d8e294b6172b4df3af78c8", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/resource_acceptance_test.go", + "sha256": "f5799e3b5d68570fffd686ca64df4482e550f9e6e9c3918cd907316395580e6c", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/state.go", + "sha256": "c431ce4a95c3748caae28b15b26b63e7f48b11d7cefea389326022a4b76b9490", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/test_helper_test.go", + "sha256": "1c4dead816fe210e0377a6e4bc6dff8bbe14a8fd7ca8b0dc7a713df9bcb3eb3e", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/maximal.tf", + "sha256": "7d14772e7e1eed2d50404d2ee6406340fcba1901c8a45456bd271a2207e02778", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/minimal.tf", + "sha256": "6978824c1c5370d77e4cc2df1a739732d4d0394f626469811463fc0c718fa5bd", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/conditional_validators.go", - "sha256": "ae4fa426e09ad4b0ac32d668b54c5a9589deecbe479756336d24b5d46d50114f", + "sha256": "81f9af09066474a5d1c46291ad56201d805cb33bcce882a4ebe5426909614917", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/construct.go", - "sha256": "6daaee0c76e9723dc560e7ed3ed5aa0c16efb4a822700933dd8623be6f1f9e99", + "sha256": "053addfc45d51bc27a6a2ebcef5307846188001af10f8b3dbfa18c87e2feaaa8", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/crud.go", - "sha256": "7d20c21aa1ecad4fa1f0acf48e5f4629aeae3634992ea7f0f9625251015d5209", + "sha256": "e337fa874ffbf948c5a448ba3e1053e1d7ab373d7d84e32288602baabe3ff3a5", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/list_acceptance_test.go", - "sha256": "f979732178ccbacb4c483769e11dc9a3a511be3fd5c84aa00d289faea0920b46", + "sha256": "3bc0499218a823dda25adc7a5a692927204bcb3b50b5ccf81194e56d38961a94", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/list_resource.go", - "sha256": "e2900d6261eecead386965263cdcaf48344ef02bcd80c3c1cdf9f18eaea9012e", + "sha256": "2a7d88a067f74997c4bcbc10e6bd216f8f693c5f5d2fb7cbb85ef5ac93d09dd5", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/model.go", - "sha256": "a1cf880bfb6f06948f64c791e818d4ff236f18756b53b22a1b239650a9de38b6", + "sha256": "14f404b99fcefb70e1f733648500df072f597e5cc995e7523ab5b12cf05bd591", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/resource.go", - "sha256": "ebd7740c100cd842e52ebf3609a90b2d63b37a81abb85e4d0b6fa1ca207b567a", + "sha256": "81d30809643dff06709267376f595784712d74ee4d0bf6fc7300736840ed2a72", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/resource_acceptance_test.go", - "sha256": "ee684411252451c6fb1a6fe318f22a2bfb99fe90714c09e8992370bd783ee6af", + "sha256": "499399b0f19687cd71041abd3e55877345150da0cd49ddd079bd94f161b9ff32", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/state.go", - "sha256": "5eff0015cf71bc4271924d1adfbb450a63f14678cc5912957b0fa2ac655befd6", + "sha256": "712b95e6160004c0424cc5aa1062ef1cf71379774d20809153f17942d2db6e62", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/test_helper_test.go", - "sha256": "7bc93299a17689930110f723388e6c5e27f5394edd1b21e437d6148d2c317c64", + "sha256": "716b4f20abddd91d9e4a7efdd9bce9f0fbf90ca21d9c08c970f241627cfda6d0", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/testdata/maximal.tf", - "sha256": "3827b38f0af446ffccbe275cdb2ef9d8d1f20de9beebc349ae7e13d3e5a15d95", + "sha256": "24c5d3bbf881182cc656c22566ddcfbeef4f952911c3ea377bf7ed86a54a9525", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/testdata/minimal.tf", - "sha256": "5af2960e74957927be662d9107c9becb3013c9656830089467160911120362f5", + "sha256": "74cf16fdd8fa95c3058569a21e8e7e26f81a3da077345bf358b0bc0aeff58ad3", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/testdata/query.tf", - "sha256": "18603a485ac5f7a660834b418deb33a41d479d0a96f12b53c94efdf39d2492cf", + "sha256": "cf00476126b7570414c35412b235d2ed3d5fc3540220c47883dfa12c64bde0b3", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/tags/v7/tag/testdata/replace.tf", - "sha256": "7af91d27b0bf39a79ee303fa3b1574f1fbcbaf0bee72802299ce4602931856f9", + "sha256": "82d58d199f371095c54f3264d9204a79a04a905212792bb1c94cfd24555b4c9a", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/construct.go", - "sha256": "b2612bc364eb1a9b68268d46570c7c3476308717be8e0c96adde9518d69dd783", + "sha256": "df4d4746b8af75f495bf578e01a3ff2da1c60e3f947d2a426cefd45870eabee0", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/crud.go", - "sha256": "05ab9e144691ac1587f9996126cdd8c453c2dcad047d59ba6938ad512efd4edc", + "sha256": "03628abdb5aebd227a8dec417287202a46c95886a7531ce288fa160f22e34e51", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/model.go", - "sha256": "c7276f0873063f65c345d12d146b969722978175927e59a62474adaa9ec82a2e", + "sha256": "5403e3f824ca53983ef589213f59fe580fe7d16fee62c251d2e35a4e150d25a9", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/resource.go", - "sha256": "e2c0eec032b337cc95053b269a06a2b533edc4caace3e97fb4f74996dd03fc19", + "sha256": "902644d449a9a31051bcc87c6073068efddd7452be71df4be6a79f1c1d1a2ef0", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/resource_acceptance_test.go", - "sha256": "6cb6eee96b0b98f2b7241d8acf70654538b3ff5334f3a66aafcd18b89c1419f7", + "sha256": "a0029d32594d32fb613de4301b11cd69e630427897ea5711f746999b3f9803c5", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/state.go", - "sha256": "3d39a8330435ed2f4884a0c9bb126c1d228fdf66a4ac16e049f2c4249542f1ca", + "sha256": "ffae5755c03465146e191d32825c7392ce100cb88e559e46cb254c954cec67c0", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/test_helper_test.go", - "sha256": "41bcbc3eced0c82f02d0317f2444fdaee749a3d15804761e8a453458486ab00e", + "sha256": "aa444d4a531eaa67a24dd90073d5e491d5b77670978ea822c942006d48a05378", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/testdata/maximal.tf", - "sha256": "65c784ae71dfcb465fdfd059ebde9074ca227fce7c71a940a6990dd20bdb39f6", + "sha256": "3deacdc3da18cd127477e3df8836a7bc8c0b4f0e8acf230ef6bbd273daad0194", "blueprint": "blueprints/thousandeyes-kiota" }, { "path": "internal/services/resources/users/v7/user/testdata/minimal.tf", - "sha256": "6824518a93ec749c5370dc081df902129054c4d6631b0dc794cd32f2f76d89be", + "sha256": "c47a3f70b2da669811a379c8009c145fa9f803b3e2e8dca151582aad1c1ab5c5", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/construct.go", + "sha256": "ac8413e8ad8faadeec77822e40d9728c318b0cc9403ae0144c6bb571a57caf24", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/crud.go", + "sha256": "9c5ee2cff3deb0185f913bf007a9a813bd569c5e144c0a19c1e900a87d70b59d", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/model.go", + "sha256": "c565a476f4c8ea5047e58d65a9dc3b44c0f4a7c3f4d7b30860f9f5fd7027869a", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/resource.go", + "sha256": "cc89491484b8ff4612b2f61c5fd75fed02f1aa375dcc594229ec89cfa7e770ef", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/state.go", + "sha256": "1c2b0a278aaef81ff5447ad97262145a45b5efc40c86bd93569de21c15be83f9", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/voice_tests/v7/tests_voice/test_helper_test.go", + "sha256": "42df544d3b1b8da070aefb9e5affd7bd6a2323f8ea4ed220558a9b18b9f0df59", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/construct.go", + "sha256": "b5b6fb90e0480e8951480cc3e5ff065ab600346e72bdf4542a7612ed0d2cf346", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/crud.go", + "sha256": "c0b0c2c39cbedd70c315b213de0a12438478da8f318810f6ff461f0fbd088790", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/model.go", + "sha256": "1ada2583168d056e511fbbfb9252825b3a2183bfe9d4d9fb69fdfc01d6ea3fad", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource.go", + "sha256": "ba500a30d1723573cfc56e121318eee0cd51bc96071f9f0ed06a84bb90c7369f", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource_acceptance_test.go", + "sha256": "d9191e97e60cb3fb627e3261ad308dab0c091c6cf34b7552e3e90c8b0dc80c94", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/state.go", + "sha256": "1c5e3514cf606aea376528bb111a7f1016670d08da68c7ad9a911b6b904ed377", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/test_helper_test.go", + "sha256": "8a183ba7fec9228130bbdd5e849194c96706527e42b5eb063172eda6903874a9", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/maximal.tf", + "sha256": "f8f0261ac2e9685ae7929498828cf330a03498d2ac7d97d94f5cf1aef25735ad", + "blueprint": "blueprints/thousandeyes-kiota" + }, + { + "path": "internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/minimal.tf", + "sha256": "c86c97c92a9f85d3318214ec4187f664f53f3a716c38f81dc42fedc543d4fc50", "blueprint": "blueprints/thousandeyes-kiota" } ] diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_agent.md b/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_agent.md new file mode 100644 index 00000000..65403f51 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_agent.md @@ -0,0 +1,74 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_agent_to_agent Resource - ThousandEyes" +subcategory: "" +description: |- + Get Agent to Agent test. +--- + +# thousandeyes_tests_agent_to_agent (Resource) + +Get Agent to Agent test. + + + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. (see [below for nested schema](#nestedatt--agents)) +- `target_agent_id` (String) `agentId` of the target agent for the test. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `description` (String) A description of the test. +- `direction` (String) Direction of the test, which affects how results are shown. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dscp_id` (String) DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). +- `mss` (Number) Maximum segment size, in bytes. +- `num_path_traces` (Number) Number of path traces executed by the agent. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `port` (Number) Target port. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. +- `throughput_duration` (Number) The throughput duration. +- `throughput_measurements` (Boolean) Enable or disable throughput measurements. Throughput measurements cannot be enabled when the source or target of the test is a cloud agent. +- `throughput_rate` (Number) The throughput rate, only applicable for UDP protocol. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `dscp` (String) DSCP label. +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_server.md b/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_server.md new file mode 100644 index 00000000..bf9d2d82 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_agent_to_server.md @@ -0,0 +1,84 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_agent_to_server Resource - ThousandEyes" +subcategory: "" +description: |- + Get Agent to Server test. +--- + +# thousandeyes_tests_agent_to_server (Resource) + +Get Agent to Server test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_agent_to_server" "example" { + interval = 3600 + server = "www.example.com" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--agents)) + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `continuous_mode` (Boolean) To enable continuous monitoring, set this parameter to `true` to. When continuous monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * `bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is set to `syn`. Observed: the API assigns false when this is omitted. +- `description` (String) A description of the test. +- `dscp_id` (String) DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If `continuousMode` is `true`, set the `fixedPacketRate` to `1` +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `ipv6_policy` (String) IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `network_measurements` (Boolean) View packet loss in 1-second intervals. This is only available for 1-minute interval tests. Set to `true` to enable network measurements. Observed: the API assigns true when this is omitted. +- `num_path_traces` (Number) Number of path traces executed by the agent. Observed: the API assigns 3 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `ping_payload_size` (Number) Payload size (not total packet size) for the end-to-end metric's probes, ping payload size allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for ICMP-based tests and 1 byte for TCP-based tests. +- `port` (Number) Port number to use for the test. The default port is 80. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `server` (String) The target name or IP address. If a port is set for the test, it is appended to the target name or IP address using a colon. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the port, www.example.com becomes www.example.com:80; the 2026-08-03 acceptance run (#13)); state carries the configured form. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `dscp` (String) DSCP label. +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_api.md b/pilot/thousandeyes-kiota/docs/resources/tests_api.md new file mode 100644 index 00000000..a0173ed0 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_api.md @@ -0,0 +1,166 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_api Resource - ThousandEyes" +subcategory: "" +description: |- + Get API test. +--- + +# thousandeyes_tests_api (Resource) + +Get API test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_api" "example" { + interval = 3600 + requests = [{ name = "step-1", url = "https://api.stripe.com/healthcheck", method = "get" }] + url = "https://api.stripe.com/healthcheck" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. (see [below for nested schema](#nestedatt--agents)) +- `requests` (Attributes Set) The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--requests)) +- `url` (String) Target for the test. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `client_cert_domains_allow_list` (String) Comma separated list of domains to send the client certificate. +- `client_certificate` (String) String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `collect_proxy_network_data` (Boolean) Indicates whether network data to the proxy should be collected. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `credentials` (Set of String) Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). +- `description` (String) A description of the test. +- `distributed_tracing` (Boolean) Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted from an update. Omitting this field from an update resets it rather than preserving the stored value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `follow_redirects` (Boolean) To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Conditionally, when networkMeasurements is "false": round-trips alone, and is stored as null the moment "networkMeasurements" rides along; isolated by bisecting the maximal body's delta. Not applied to the schema, because this holds only under that condition and the schema has no way to say so. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_agent_proxy` (Boolean) Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_proxy_id` (String) ID of the proxy to be used if the default proxy is overridden. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `predefined_variables` (Attributes Set) (see [below for nested schema](#nestedatt--predefined_variables)) +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `ssl_version_id` (String) SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `target_time` (Number) Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 means default behavior) Observed: the API assigns 6 when this is omitted. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `time_limit` (Number) Time limit for transaction in seconds. Exceeding this limit will result in a Timeout error. Observed: the API assigns 10 when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `vault_credentials` (Attributes Set) List of credential IDs that are stored in an external vault. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. (see [below for nested schema](#nestedatt--vault_credentials)) + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `requests` + +Required: + +- `name` (String) API step name, must be unique. Observed: the API assigns "step-1" when this is omitted. +- `url` (String) Request url. Supports variables in the format `{{variableName}}`. Observed: the API assigns "https://api.stripe.com/healthcheck" when this is omitted. + +Optional: + +- `assertions` (Attributes Set) List of assertion objects. (see [below for nested schema](#nestedatt--requests--assertions)) +- `auth_type` (String) Will override the Authorization request header. Values accepted here: `none`, `basic`, `bearer-token`, `oauth2`. Observed: the API assigns "none" when this is omitted. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. +- `bearer_token` (String) The bearer token if `authType = bearer-token`. +- `body` (String) POST/PUT request body. Must be in JSON format. +- `client_authentication` (String) The OAuth2 client authentication location type. Values accepted here: `basic-auth-header`, `in-body`. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. +- `client_id` (String) The application ID used when `authType` is set to "oauth2". +- `client_secret` (String) The private client secret used when `authType` is set to "oauth2". +- `collect_api_response` (Boolean) Set to `true` if API response body should be collected and saved. Set to `false` if API response body should not be saved. Observed: the API assigns false when this is omitted. +- `headers` (Attributes Set) Array of API Request Header objects. (see [below for nested schema](#nestedatt--requests--headers)) +- `method` (String) HTTP request method. Values accepted here: `get`, `post`, `put`, `delete`, `patch`. Observed: the API assigns "get" when this is omitted. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. +- `password` (String) The password if `authType = basic`. +- `scope` (String) Application-specific scope values for the access token when `authType` is "oauth2". +- `token_url` (String) The endpoint used to request the access token when `authType` is "oauth2". +- `username` (String) The username if `authType = basic`. +- `variables` (Attributes Set) Array of API post request variable objects. (see [below for nested schema](#nestedatt--requests--variables)) +- `verify_certificate` (Boolean) Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns false when this is omitted. +- `wait_time_ms` (Number) Post request delay before executing the next API requests, in milliseconds. + + +### Nested Schema for `requests.assertions` + +Optional: + +- `name` (String) Set to `status-code` to assert the response status code. Set to `response-body` to assert data is present in the response body. Use `ApiRequestAssertion` to set the value for the assertion. Values accepted here: `status-code`, `response-body`. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. +- `operator` (String) If `name = status-code``, accepted values are [is, is-not]. If `name = response-body``, accepted values are [includes, not-includes, matches, not-matches]`. Values accepted here: `is`, `is-not`, `includes`, `not-includes`, `matches`, `not-matches`. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. +- `value` (String) The value of the assertion. If name = `status-code`, the status code to assert. If name = `response-body`, the lookup value to assert. + + + +### Nested Schema for `requests.headers` + +Optional: + +- `key` (String) Request header key. +- `value` (String) Request header value. Supports variables `{{variableName}}`. + + + +### Nested Schema for `requests.variables` + +Optional: + +- `name` (String) Variable name +- `value` (String) The JSON path of data within the Response Body to assign to this variable. + + + + +### Nested Schema for `predefined_variables` + +Optional: + +- `name` (String) Variable name. Must be unique. +- `value` (String) Variable value, will be treated as string. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + + + +### Nested Schema for `vault_credentials` + +Optional: + +- `secret_id` (String) UUID of the configured secret. +- `target` (String) The target setting that the credential should be used for. Values accepted here: `username`, `password`, `script`. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_bgp.md b/pilot/thousandeyes-kiota/docs/resources/tests_bgp.md new file mode 100644 index 00000000..a74ba962 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_bgp.md @@ -0,0 +1,57 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_bgp Resource - ThousandEyes" +subcategory: "" +description: |- + Get BGP test. +--- + +# thousandeyes_tests_bgp (Resource) + +Get BGP test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_bgp" "example" { + prefix = "8.8.8.0/24" +} +``` + + +## Schema + +### Required + +- `prefix` (String) a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any length from 8 to 24. The API enforces this field's presence, which the specification does not declare. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `description` (String) A description of the test. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `include_covered_prefixes` (Boolean) Indicate if queries for subprefixes detected under this prefix should included. Observed: the API assigns false when this is omitted. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_dns_server.md b/pilot/thousandeyes-kiota/docs/resources/tests_dns_server.md new file mode 100644 index 00000000..2ba5a225 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_dns_server.md @@ -0,0 +1,84 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_dns_server Resource - ThousandEyes" +subcategory: "" +description: |- + Get DNS Server test. +--- + +# thousandeyes_tests_dns_server (Resource) + +Get DNS Server test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_dns_server" "example" { + dns_servers = ["8.8.8.8"] + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--agents)) +- `dns_servers` (Set of String) A list of DNS server FQDN. Sent as a list of server names; the read reports servers as objects, which v1 does not round-trip. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. +- `domain` (String) The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, example.com becomes "example.com ANY"; the 2026-08-03 acceptance run (#13)); state carries the configured form. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Observed: the API assigns false when this is omitted. SDK limitation: the wire field is a value-typed bool with omitempty, so an explicit `false` cannot be sent; with `network_measurements = true` the API then treats bandwidth measurement as requested, which cloud agents refuse. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `description` (String) A description of the test. +- `dns_query_class` (String) Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dns_transport_protocol` (String) Transport protocol used for DNS requests. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `ipv6_policy` (String) IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Observed: the API assigns 1 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `recursive_queries` (Boolean) Set true to run query with RD (recursion desired) flag enabled. Observed: the API assigns false when this is omitted. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Computed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions. +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_dns_trace.md b/pilot/thousandeyes-kiota/docs/resources/tests_dns_trace.md new file mode 100644 index 00000000..a6fee2d1 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_dns_trace.md @@ -0,0 +1,70 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_dns_trace Resource - ThousandEyes" +subcategory: "" +description: |- + Get DNS Trace test. +--- + +# thousandeyes_tests_dns_trace (Resource) + +Get DNS Trace test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_dns_trace" "example" { + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--agents)) +- `domain` (String) The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, example.com becomes "example.com ANY"; the 2026-08-03 acceptance run (#13)); state carries the configured form. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `description` (String) A description of the test. +- `dns_query_class` (String) Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dns_transport_protocol` (String) Transport protocol used for DNS requests. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_dnssec.md b/pilot/thousandeyes-kiota/docs/resources/tests_dnssec.md new file mode 100644 index 00000000..bcc1d4b6 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_dnssec.md @@ -0,0 +1,69 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_dnssec Resource - ThousandEyes" +subcategory: "" +description: |- + Get DNSSEC test. +--- + +# thousandeyes_tests_dnssec (Resource) + +Get DNSSEC test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_dnssec" "example" { + domain = "cloudflare.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--agents)) +- `domain` (String) The target record for the test, with the record type suffixed. If no record type is specified, the test defaults to an ANY record. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, cloudflare.com becomes "cloudflare.com ANY"; the 2026-08-03 acceptance run (#13)); state carries the configured form. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `description` (String) A description of the test. +- `dns_query_class` (String) Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_ftp_server.md b/pilot/thousandeyes-kiota/docs/resources/tests_ftp_server.md new file mode 100644 index 00000000..cc0346ae --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_ftp_server.md @@ -0,0 +1,90 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_ftp_server Resource - ThousandEyes" +subcategory: "" +description: |- + Get FTP Server test. +--- + +# thousandeyes_tests_ftp_server (Resource) + +Get FTP Server test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_ftp_server" "example" { + interval = 3600 + password = "guest" + request_type = "download" + url = "ftp://speedtest.tele2.net" + username = "anonymous" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. (see [below for nested schema](#nestedatt--agents)) +- `request_type` (String) Set the type of activity for the test. Values accepted here: `download`, `list`. The API enforces this field's presence, which the specification does not declare. +- `url` (String) Target for the test. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. The API normalises this value (appends a trailing slash; the 2026-08-03 acceptance run (#13)); state carries the configured form. +- `username` (String) Username for Basic/NTLM authentication. The API enforces this field's presence, which the specification does not declare. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `description` (String) A description of the test. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `download_limit` (Number) Specify maximum number of bytes to download from the target object. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `ftp_target_time` (Number) Target time for operation completion; specified in milliseconds. Observed: the API assigns 1000 when this is omitted. +- `ftp_time_limit` (Number) Set the time limit for the test in seconds. Observed: the API assigns 5 when this is omitted. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `ipv6_policy` (String) IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Observed: the API assigns 3 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `password` (String, Sensitive) Password for Basic/NTLM authentication. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. Write-only: the API never returns it (the 2026-08-03 acceptance run (#13)); state carries the configured value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_active_ftp` (Boolean) Explicitly set the flag to use active FTP. Observed: the API assigns false when this is omitted. +- `use_explicit_ftps` (Boolean) Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate to use FTPS. Observed: the API assigns false when this is omitted. +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Computed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions. +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_http_server.md b/pilot/thousandeyes-kiota/docs/resources/tests_http_server.md new file mode 100644 index 00000000..fb1bee77 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_http_server.md @@ -0,0 +1,115 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_http_server Resource - ThousandEyes" +subcategory: "" +description: |- + Get HTTP Server test. +--- + +# thousandeyes_tests_http_server (Resource) + +Get HTTP Server test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_http_server" "example" { + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. (see [below for nested schema](#nestedatt--agents)) + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `allow_unsafe_legacy_renegotiation` (Boolean) Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `auth_type` (String) HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `client_certificate` (String) String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `collect_proxy_network_data` (Boolean) Indicates whether network data to the proxy should be collected. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `content_regex` (String) Content regex, this field does not require escaping. Observed: the API assigns "" when this is omitted. +- `description` (String) A description of the test. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `desired_status_code` (String) Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `distributed_tracing` (Boolean) Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dns_override` (String) IP address to use for DNS override. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `download_limit` (Number) Specifies maximum number of bytes to download from the target object. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `follow_redirects` (Boolean) To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `headers` (Set of String) HTTP request headers used. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `http_target_time` (Number) Target time for HTTP server completion, specified in milliseconds. Observed: the API assigns 1000 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_time_limit` (Number) HTTP time limit in seconds. Observed: the API assigns 5 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_version` (Number) HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Observed: the API assigns 2 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `include_headers` (Boolean) Set to `true` to capture response headers for objects loaded by the test. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `ipv6_policy` (String) IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Observed: the API assigns 3 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_agent_proxy` (Boolean) Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_proxy_id` (String) ID of the proxy to be used if the default proxy is overridden. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `password` (String) Password for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `post_body` (String) Enter the body for the HTTP POST request in this field. No special escaping is required. If content is provided and `requestMethod` is not specified, `requestMethod` is automatically set to `post`. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `request_method` (String) HTTP request method. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `ssl_version_id` (String) SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `url` (String) Target for the test. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. +- `use_ntlm` (Boolean) Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `user_agent` (String) User-agent string to be provided during the test. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Neither the update response nor a read returns this field: it is write-only in practice, and state carries the configured value. +- `username` (String) Username for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `vault_credentials` (Attributes Set) List of credential IDs that are stored in an external vault. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. (see [below for nested schema](#nestedatt--vault_credentials)) +- `verify_certificate` (Boolean) Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. Computed only on this endpoint: the SDK's value-typed omitempty bool cannot send false, and an update carrying true without an explicit bandwidthMeasurements false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no configurable value is expressible in both directions. +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `ssl_version` (String) Reflects the verbose SSL protocol version used by a test. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + + + +### Nested Schema for `vault_credentials` + +Optional: + +- `secret_id` (String) UUID of the configured secret. +- `target` (String) The target setting that the credential should be used for. diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_page_load.md b/pilot/thousandeyes-kiota/docs/resources/tests_page_load.md new file mode 100644 index 00000000..e7b0ebdc --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_page_load.md @@ -0,0 +1,124 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_page_load Resource - ThousandEyes" +subcategory: "" +description: |- + Get Page Load test. +--- + +# thousandeyes_tests_page_load (Resource) + +Get Page Load test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_page_load" "example" { + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the specification does not declare. (see [below for nested schema](#nestedatt--agents)) + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Observed: the API assigns true when this is omitted. +- `allow_geolocation` (Boolean) Set true to use the agent’s geolocation by the web page. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `allow_mic_and_camera` (Boolean) Set true allow the use of a fake mic and camera in the browser. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `allow_unsafe_legacy_renegotiation` (Boolean) Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `auth_type` (String) HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `block_domains` (String) Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. Observed: the API assigns "" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `browser_language` (String) Set one of the available browser language that you want to use to configure the browser. Observed: the API assigns "en-US" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `chrome_options` (String) Command-line options passed to Chrome when running the test. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `client_certificate` (String) String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `collect_proxy_network_data` (Boolean) Indicates whether network data to the proxy should be collected. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `content_regex` (String) Content regex, this field does not require escaping. Observed: the API assigns "" when this is omitted. +- `description` (String) A description of the test. +- `desired_status_code` (String) Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `disable_screenshot` (Boolean) Enables or disables screenshots on error. Set true to not capture Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `distributed_tracing` (Boolean) Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dns_override` (String) IP address to use for DNS override. Write-only on this endpoint: the read never reports it (local acceptance run, 2026-08-03); state carries the configured value. +- `download_limit` (Number) Specifies maximum number of bytes to download from the target object. This endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value. +- `emulated_device_id` (String) ID of the emulated device, if one was given when the test was created. Observed: the API assigns "281474976710656" when this is omitted. +- `enabled` (Boolean) Test is enabled. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `follow_redirects` (Boolean) To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_interval` (Number) HTTP test run interval. The interval between HTTP test runs in seconds cannot exceed the specified interval value and defaults to the same value as the interval if not set. Documented values: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_target_time` (Number) Target time for HTTP server completion, specified in milliseconds. Observed: the API assigns 1000 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_time_limit` (Number) HTTP time limit in seconds. Observed: the API assigns 5 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_version` (Number) HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Observed: the API assigns 2 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `identify_agent_traffic_with_user_agent` (Boolean) Determines how agent traffic is identified: * `false`: Adds the `x-thousandeyes-agent: yes` header. * `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header. For more information, see [Notes on Agent ID Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy). Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `include_headers` (Boolean) Set to `true` to capture response headers for objects loaded by the test. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). The API enforces this field's presence, which the specification does not declare. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Observed: the API assigns 3 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_agent_proxy` (Boolean) Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_proxy_id` (String) ID of the proxy to be used if the default proxy is overridden. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `page_load_target_time` (Number) Target time for page load completion, specified in seconds and cannot exceed the `pageLoadTimeLimit`. Observed: the API assigns 6 when this is omitted. +- `page_load_time_limit` (Number) Page load time limit. Must be larger than the `httpTimeLimit`. Observed: the API assigns 10 when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `page_loading_strategy` (String) * `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the "interactive" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `password` (String) Password for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification documents `udp`, which the API rejected. Observed: the API assigns "tcp" when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `ssl_version_id` (String) SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `subinterval` (Number) Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval. Documented values: `60`, `120`, `300`, `600`, `900`, `1200`, `1800`, `3600`. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `url` (String) Target for the test. The test's target: the API refuses a create without it, whatever the specification marks. The API enforces this field's presence, which the specification does not declare. +- `use_ntlm` (Boolean) Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. Observed: the API assigns false when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `user_agent` (String) User-agent string to be provided during the test. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `username` (String) Username for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `vault_credentials` (Attributes Set) List of credential IDs that are stored in an external vault. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. (see [below for nested schema](#nestedatt--vault_credentials)) +- `verify_certificate` (Boolean) Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Observed: the API assigns true when this is omitted. Computed only on this endpoint: browser tests always network-measure, and the SDK's value-typed omitempty bool cannot express false anyway (local acceptance run, 2026-08-03). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `ssl_version` (String) Reflects the verbose SSL protocol version used by a test. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + + + +### Nested Schema for `vault_credentials` + +Optional: + +- `secret_id` (String) UUID of the configured secret. +- `target` (String) The target setting that the credential should be used for. Values accepted here: `username`, `password`, `script`. The API accepted a value from outside the documented set, so no OneOf validator is generated for this attribute. diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_sip_server.md b/pilot/thousandeyes-kiota/docs/resources/tests_sip_server.md new file mode 100644 index 00000000..38dd7cf8 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_sip_server.md @@ -0,0 +1,85 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_sip_server Resource - ThousandEyes" +subcategory: "" +description: |- + Get SIP Server test. +--- + +# thousandeyes_tests_sip_server (Resource) + +Get SIP Server test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_sip_server" "example" { + interval = 3600 + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. (see [below for nested schema](#nestedatt--agents)) + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `description` (String) A description of the test. +- `enabled` (Boolean) Test is enabled. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). +- `ipv6_policy` (String) IP version policy. Overrides the IPv6 policy configured at the agent level. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `options_regex` (String) Options regex, this field does not require escaping. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `register_enabled` (Boolean) Set to true to perform SIP registration on the test target with the SIP REGISTER command. +- `sip_target_time` (Number) Target time for test completion in milliseconds. +- `sip_time_limit` (Number) Time limit in milliseconds. +- `test_name` (String) The name of the test. Test name must be unique. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `auth_user` (String) Username for authentication with SIP server. +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `password` (String) Password for Basic/NTLM authentication. +- `port` (Number) Target port. +- `protocol` (String) Transport layer for SIP communication. +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `sip_registrar` (String) SIP server to be tested, specified by domain name or IP address. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. +- `user` (String) Username for SIP registration, should be unique within a ThousandEyes account group. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_voice.md b/pilot/thousandeyes-kiota/docs/resources/tests_voice.md new file mode 100644 index 00000000..e54cd070 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_voice.md @@ -0,0 +1,70 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_voice Resource - ThousandEyes" +subcategory: "" +description: |- + Get Voice test. +--- + +# thousandeyes_tests_voice (Resource) + +Get Voice test. + + + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. (see [below for nested schema](#nestedatt--agents)) +- `target_agent_id` (String) Agent ID of the target agent for the test. + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `codec_id` (String) Codec identifier for the RTP stream. Valid values: * `0`: G.711 @ 64 Kbps * `1`: G.722.1 @ 24 Kbps (WB) * `2`: G.722.1 @ 32 Kbps (WB) * `3`: G.726 @ 32 Kbps * `4`: G.723.1 @ 6.4 Kbps * `5`: G.729a @ 8 Kbps * `6`: RTAudio @ 45 Kbps (WB) * `7`: RTAudio @ 27.8 Kbps * `8`: SILK @ 36 Kbps (WB) * `9`: G.722 @ 64 Kbps (WB) +- `description` (String) A description of the test. +- `dscp_id` (String) DSCP ID [to see list for acceptable values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `duration` (Number) Duration of the test in seconds. +- `enabled` (Boolean) Test is enabled. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). +- `jitter_buffer` (Number) De-jitter buffer size in seconds. +- `num_path_traces` (Number) Number of path traces executed by the agent. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `port` (Number) Port number for the chosen protocol. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `test_name` (String) The name of the test. Test name must be unique. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `codec` (String) Codec label +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `dscp` (String) DSCP label. +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). diff --git a/pilot/thousandeyes-kiota/docs/resources/tests_web_transaction.md b/pilot/thousandeyes-kiota/docs/resources/tests_web_transaction.md new file mode 100644 index 00000000..9b0571a0 --- /dev/null +++ b/pilot/thousandeyes-kiota/docs/resources/tests_web_transaction.md @@ -0,0 +1,126 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "thousandeyes_tests_web_transaction Resource - ThousandEyes" +subcategory: "" +description: |- + Get Web Transactions test. +--- + +# thousandeyes_tests_web_transaction (Resource) + +Get Web Transactions test. + +## Example Usage + +```terraform +resource "thousandeyes_tests_web_transaction" "example" { + interval = 3600 + transaction_script = "tfacc-transaction-script" + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} +``` + + +## Schema + +### Required + +- `agents` (Attributes Set) The agents the test runs from. Sent on create and update; the read reports assignment through its own fields, so this does not round-trip into state. (see [below for nested schema](#nestedatt--agents)) +- `transaction_script` (String) JavaScript of a web transaction test. Quotes must be escaped (precede " characters with \ ). + +### Optional + +- `alerts_enabled` (Boolean) Indicates if alerts are enabled. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `allow_geolocation` (Boolean) Set true to use the agent’s geolocation by the web page. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `allow_mic_and_camera` (Boolean) Set true allow the use of a fake mic and camera in the browser. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `allow_unsafe_legacy_renegotiation` (Boolean) Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to allow unsafe legacy renegotiation. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `auth_type` (String) HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bandwidth_measurements` (Boolean) Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned to the test. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `bgp_measurements` (Boolean) Set to `true` to enable bgp measurements. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `block_domains` (String) Domains or full object URLs to be excluded from metrics and waterfall data for transaction tests. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `browser_language` (String) Set one of the available browser language that you want to use to configure the browser. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `chrome_options` (String) Command-line options passed to Chrome when running the test. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `client_certificate` (String) String representation (containing newline characters) of client certificate, the private key must be placed first, then the certificate. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `collect_proxy_network_data` (Boolean) Indicates whether network data to the proxy should be collected. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `content_regex` (String) Content regex, this field does not require escaping. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `credentials` (Set of String) Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint). +- `description` (String) A description of the test. +- `desired_status_code` (String) Specify the HTTP status code value that indicates a successful response. The default value accepts any 2xx or 3xx status code. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `disable_screenshot` (Boolean) Enables or disables screenshots on error. Set true to not capture Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `distributed_tracing` (Boolean) Adds distributed tracing headers to API requests using B3 and W3C standards. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `dns_override` (String) IP address to use for DNS override. This endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value. +- `download_limit` (Number) Specifies maximum number of bytes to download from the target object. This endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value. +- `emulated_device_id` (String) ID of the emulated device, if specified when the test was created. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `enabled` (Boolean) Test is enabled. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `fixed_packet_rate` (Number) Sets packets rate sent to measure the network in packets per second. This endpoint never reports the value back (local acceptance run, 2026-08-03); state carries the configured value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `follow_redirects` (Boolean) To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to `false`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_target_time` (Number) Target time for HTTP server completion, specified in milliseconds. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_time_limit` (Number) HTTP time limit in seconds. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `http_version` (Number) HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `identify_agent_traffic_with_user_agent` (Boolean) Determines how agent traffic is identified: * `false`: Adds the `x-thousandeyes-agent: yes` header. * `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header. For more information, see [Notes on Agent ID Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy). Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `include_headers` (Boolean) Set to `true` to capture response headers for objects loaded by the test. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `interval` (Number) Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). +- `mtu_measurements` (Boolean) Set `true` to measure MTU sizes on network from agents to the target. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `num_path_traces` (Number) Number of path traces executed by the agent. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_agent_proxy` (Boolean) Flag indicating if a proxy other than the default should be used. To override the default proxy for agents, set to `true` and specify a value for `overrideProxyId`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `override_proxy_id` (String) ID of the proxy to be used if the default proxy is overridden. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `page_loading_strategy` (String) * `normal`: The test waits until the entire page is fully loaded, including the downloading and parsing of HTML content as well as all associated resources, before advancing to the next action in the transaction test script. * `eager`: The test waits for the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the document reaches the "interactive" readiness state, before proceeding to the next action in the test script. * `none`: The test only waits for the download of HTML content. Once the HTML is downloaded, the test continues to the next action in the transaction test script without waiting for additional resources. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `password` (String) Password for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `path_trace_mode` (String) Select `inSession` to perform the path trace within a TCP session. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `probe_mode` (String) Probe mode used by network test, only valid when the protocol is set to TCP. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `protocol` (String) Protocol used by dependent network tests (end-to-end, path trace, PMTUD). The specification documents `udp`, which the API rejected. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `randomized_start_time` (Boolean) Indicates whether agents should randomize the start time in each test round. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `ssl_version_id` (String) SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `subinterval` (Number) Subinterval for round-robin testing (in seconds). Must be less than or equal to interval and must evenly divide interval. Documented values: `60`, `120`, `300`, `600`, `900`, `1200`, `1800`, `3600`. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `target_time` (Number) Target completion time, in seconds. Defaults to 10. Cannot exceed the `timeLimit` value. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `test_name` (String) The name of the test. Test name must be unique. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. +- `time_limit` (Number) Time limit for transaction in seconds. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts)) +- `url` (String) Target for the test. The test's target: the API refuses a create without it, whatever the specification marks. +- `use_ntlm` (Boolean) Set to true to use NTLM, false to use Basic Authentication. Requires username and password to be set. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `use_public_bgp` (Boolean) Indicate if all available public BGP monitors should be used, when omitted defaults to `bgpMeasurements` value. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `user_agent` (String) User-agent string to be provided during the test. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `username` (String) Username for Basic/NTLM authentication. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. +- `vault_credentials` (Attributes Set) List of credential IDs that are stored in an external vault. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. (see [below for nested schema](#nestedatt--vault_credentials)) +- `verify_certificate` (Boolean) Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or "" silently becomes an omission. + +### Read-Only + +- `created_by` (String) User that created the test. +- `created_date` (String) UTC created date (ISO date-time format). +- `id` (String) Each test is assigned an unique ID; this is used to access test information and results from other endpoints. +- `live_share` (Boolean) Indicates if the test is shared with the account group. +- `modified_by` (String) User that modified the test. +- `modified_date` (String) UTC last modification date (ISO date-time format). +- `network_measurements` (Boolean) Enable or disable network measurements. Set to true to enable or false to disable network measurements. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when this is omitted. Computed only on this endpoint: browser tests always network-measure, and the SDK's value-typed omitempty bool cannot express false anyway (local acceptance run, 2026-08-03). +- `saved_event` (Boolean) Indicates if the test is a saved event. **Note**: **Saved Events** are now called **Private Snapshots** in the user interface. This change does not affect API. +- `ssl_version` (String) Reflects the verbose SSL protocol version used by a test. +- `type` (String) This is a read only value, as test type is implicit in the test creation url. + + +### Nested Schema for `agents` + +Required: + +- `agent_id` (String) The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers are stable public values. + + + +### Nested Schema for `timeouts` + +Optional: + +- `create` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). +- `delete` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs. +- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled. +- `update` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). + + + +### Nested Schema for `vault_credentials` + +Optional: + +- `secret_id` (String) UUID of the configured secret. +- `target` (String) The target setting that the credential should be used for. diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_agent_to_server/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_agent_to_server/resource.tf new file mode 100644 index 00000000..356676f9 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_agent_to_server/resource.tf @@ -0,0 +1,5 @@ +resource "thousandeyes_tests_agent_to_server" "example" { + interval = 3600 + server = "www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_api/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_api/resource.tf new file mode 100644 index 00000000..31524eb0 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_api/resource.tf @@ -0,0 +1,6 @@ +resource "thousandeyes_tests_api" "example" { + interval = 3600 + requests = [{ name = "step-1", url = "https://api.stripe.com/healthcheck", method = "get" }] + url = "https://api.stripe.com/healthcheck" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_bgp/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_bgp/resource.tf new file mode 100644 index 00000000..32398b0b --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_bgp/resource.tf @@ -0,0 +1,3 @@ +resource "thousandeyes_tests_bgp" "example" { + prefix = "8.8.8.0/24" +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_server/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_server/resource.tf new file mode 100644 index 00000000..44bbb663 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_server/resource.tf @@ -0,0 +1,6 @@ +resource "thousandeyes_tests_dns_server" "example" { + dns_servers = ["8.8.8.8"] + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_trace/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_trace/resource.tf new file mode 100644 index 00000000..0ed22328 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dns_trace/resource.tf @@ -0,0 +1,5 @@ +resource "thousandeyes_tests_dns_trace" "example" { + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dnssec/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dnssec/resource.tf new file mode 100644 index 00000000..eb26d222 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_dnssec/resource.tf @@ -0,0 +1,5 @@ +resource "thousandeyes_tests_dnssec" "example" { + domain = "cloudflare.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_ftp_server/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_ftp_server/resource.tf new file mode 100644 index 00000000..37224021 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_ftp_server/resource.tf @@ -0,0 +1,8 @@ +resource "thousandeyes_tests_ftp_server" "example" { + interval = 3600 + password = "guest" + request_type = "download" + url = "ftp://speedtest.tele2.net" + username = "anonymous" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_http_server/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_http_server/resource.tf new file mode 100644 index 00000000..590be66a --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_http_server/resource.tf @@ -0,0 +1,5 @@ +resource "thousandeyes_tests_http_server" "example" { + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_page_load/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_page_load/resource.tf new file mode 100644 index 00000000..7c8a77b8 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_page_load/resource.tf @@ -0,0 +1,5 @@ +resource "thousandeyes_tests_page_load" "example" { + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_sip_server/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_sip_server/resource.tf new file mode 100644 index 00000000..5efe8bb7 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_sip_server/resource.tf @@ -0,0 +1,4 @@ +resource "thousandeyes_tests_sip_server" "example" { + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_web_transaction/resource.tf b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_web_transaction/resource.tf new file mode 100644 index 00000000..665c0383 --- /dev/null +++ b/pilot/thousandeyes-kiota/examples/resources/thousandeyes_tests_web_transaction/resource.tf @@ -0,0 +1,6 @@ +resource "thousandeyes_tests_web_transaction" "example" { + interval = 3600 + transaction_script = "tfacc-transaction-script" + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/provider/actions.go b/pilot/thousandeyes-kiota/internal/provider/actions.go index 5e8dafa8..15c002db 100644 --- a/pilot/thousandeyes-kiota/internal/provider/actions.go +++ b/pilot/thousandeyes-kiota/internal/provider/actions.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package provider diff --git a/pilot/thousandeyes-kiota/internal/provider/datasources.go b/pilot/thousandeyes-kiota/internal/provider/datasources.go index 3b98108d..341be04d 100644 --- a/pilot/thousandeyes-kiota/internal/provider/datasources.go +++ b/pilot/thousandeyes-kiota/internal/provider/datasources.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package provider diff --git a/pilot/thousandeyes-kiota/internal/provider/ephemerals.go b/pilot/thousandeyes-kiota/internal/provider/ephemerals.go index ce63cc3d..550dbda6 100644 --- a/pilot/thousandeyes-kiota/internal/provider/ephemerals.go +++ b/pilot/thousandeyes-kiota/internal/provider/ephemerals.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package provider diff --git a/pilot/thousandeyes-kiota/internal/provider/list_resources.go b/pilot/thousandeyes-kiota/internal/provider/list_resources.go index e1dd1709..bd76d50f 100644 --- a/pilot/thousandeyes-kiota/internal/provider/list_resources.go +++ b/pilot/thousandeyes-kiota/internal/provider/list_resources.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package provider diff --git a/pilot/thousandeyes-kiota/internal/provider/resources.go b/pilot/thousandeyes-kiota/internal/provider/resources.go index c9c0eacb..2706bc26 100644 --- a/pilot/thousandeyes-kiota/internal/provider/resources.go +++ b/pilot/thousandeyes-kiota/internal/provider/resources.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package provider @@ -9,12 +9,25 @@ import ( "github.com/hashicorp/terraform-plugin-framework/resource" v7AccountGroup "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group" + v7TestsAgentToAgent "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent" + v7TestsAgentToServer "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server" v7AlertSuppressionWindow "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window" + v7TestsAPI "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api" + v7TestsBGP "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp" v7Credential "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential" + v7TestsDNSServer "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server" + v7TestsDNSTrace "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace" + v7TestsDNSSEC "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec" v7EndpointLabel "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label" + v7TestsFTPServer "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server" + v7TestsHTTPServer "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server" + v7TestsPageLoad "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load" v7Role "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role" + v7TestsSIPServer "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server" v7Tag "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag" v7User "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user" + v7TestsVoice "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice" + v7TestsWebTransaction "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction" ) // Resources returns every managed resource this provider serves. @@ -29,6 +42,19 @@ func (p *Provider) Resources(_ context.Context) []func() resource.Resource { v7EndpointLabel.NewEndpointLabelResource, v7Role.NewRoleResource, v7Tag.NewTagResource, + v7TestsAPI.NewTestsAPIResource, + v7TestsAgentToAgent.NewTestsAgentToAgentResource, + v7TestsAgentToServer.NewTestsAgentToServerResource, + v7TestsBGP.NewTestsBGPResource, + v7TestsDNSSEC.NewTestsDNSSECResource, + v7TestsDNSServer.NewTestsDNSServerResource, + v7TestsDNSTrace.NewTestsDNSTraceResource, + v7TestsFTPServer.NewTestsFTPServerResource, + v7TestsHTTPServer.NewTestsHTTPServerResource, + v7TestsPageLoad.NewTestsPageLoadResource, + v7TestsSIPServer.NewTestsSIPServerResource, + v7TestsVoice.NewTestsVoiceResource, + v7TestsWebTransaction.NewTestsWebTransactionResource, v7User.NewUserResource, } } diff --git a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action.go b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action.go index 1f1e3e6b..147c6bb3 100644 --- a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action.go +++ b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/disable-endpoint-agent/ package disable_endpoint_agent diff --git a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action_acceptance_test.go index 96827766..cd425a74 100644 --- a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/action_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package disable_endpoint_agent_test diff --git a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/invoke.go b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/invoke.go index 207cbda7..c354fdd4 100644 --- a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/invoke.go +++ b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/invoke.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package disable_endpoint_agent diff --git a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/model.go b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/model.go index 31573e01..680d895c 100644 --- a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/model.go +++ b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package disable_endpoint_agent diff --git a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/testdata/action.tf b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/testdata/action.tf index 0e4449fe..3cedb5d3 100644 --- a/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/testdata/action.tf +++ b/pilot/thousandeyes-kiota/internal/services/actions/endpoint_agents/v7/disable_endpoint_agent/testdata/action.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The action under test, invoked once by a terraform_data trigger on create. The # subject's identifier arrives as a variable, supplied by the generated test from the diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource.go index 70e5ae7a..c8d862e9 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource_acceptance_test.go index 1ff3f1de..407e219a 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/datasource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag_test diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/model.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/model.go index 346e210c..f29b6b19 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/model.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/get-tag/ package tag diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/read.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/read.go index 0ccb7b59..d54d44fa 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/read.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/read.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/seed_helper_test.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/seed_helper_test.go index 55015087..2cf44910 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/seed_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/seed_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/state.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/state.go index 6b956004..7fcb778f 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/state.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/testdata/datasource.tf b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/testdata/datasource.tf index 86631a54..c6ca0530 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/testdata/datasource.tf +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tag/testdata/datasource.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The seed resource this data source reads back, then the data block itself. One file, # because the reference below only resolves against the resource above it. diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource.go index 9b64593b..c4cb4b84 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tags diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource_acceptance_test.go index 2170ceef..7d8befdf 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/datasource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tags_test diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/model.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/model.go index d0b1ec4f..35c0d6f8 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/model.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/list-tags/ package tags diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/read.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/read.go index fca9763f..83821692 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/read.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/read.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tags diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/seed_helper_test.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/seed_helper_test.go index 2fccba5b..7f9f3a55 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/seed_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/seed_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tags diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/state.go b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/state.go index fd6f9a6b..9866761a 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/state.go +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tags diff --git a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/testdata/datasource.tf b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/testdata/datasource.tf index d6cc2b3c..dd08ef5a 100644 --- a/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/testdata/datasource.tf +++ b/pilot/thousandeyes-kiota/internal/services/datasources/tags/v7/tags/testdata/datasource.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The seed resource this data source reads back, then the data block itself. One file, # because the reference below only resolves against the resource above it. diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral.go index d23be81a..a1af8c2a 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral_acceptance_test.go index f35bb348..cfc02221 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/ephemeral_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential_test diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/model.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/model.go index 949439ed..92801df1 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/model.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/get-credential/ package credential diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/open.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/open.go index 1c09f617..a8016322 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/open.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/open.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/seed_helper_test.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/seed_helper_test.go index 452f2ae7..eeda3a08 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/seed_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/seed_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/state.go b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/state.go index a02d1ede..70676876 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/state.go +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/testdata/ephemeral.tf b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/testdata/ephemeral.tf index 8f53d45e..5bcb4c6b 100644 --- a/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/testdata/ephemeral.tf +++ b/pilot/thousandeyes-kiota/internal/services/ephemerals/credentials/v7/credential/testdata/ephemeral.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The seed resource, the ephemeral that opens it, and the echo that makes the opened # value observable. One file, because each reference only resolves against the block diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/construct.go index 33228342..e35416dc 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/crud.go index 2df40c86..f6fee894 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/model.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/model.go index 5fa531f1..9377e8e2 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource.go index 17f7dbcc..71b1d89c 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource_acceptance_test.go index 6fcaa605..723b94f4 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/state.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/state.go index f570ea7f..54dfa95f 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/test_helper_test.go index 63474b9e..d6343278 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package account_group diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/maximal.tf index 894c5394..3040e3c9 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/minimal.tf index ba039a4d..d2d06e2e 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/account_groups/v7/account_group/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/construct.go new file mode 100644 index 00000000..51466bec --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/construct.go @@ -0,0 +1,90 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsAgentToAgentResourceModel) (*models.Tests_API_AgentToAgentTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_AgentToAgentTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + directionRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDirection](data.Direction, models.ParseTests_API_TestDirection) + diags.Append(d...) + body.SetDirection(directionRaw) + dscpIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDscpId](data.DscpID, models.ParseTests_API_TestDscpId) + diags.Append(d...) + body.SetDscpId(dscpIDRaw) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetMss(convert.FrameworkInt64ToPtrInt32(data.Mss)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + body.SetPort(convert.FrameworkInt64ToPtrInt32(data.Port)) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_AgentToAgentTestProtocol](data.Protocol, models.ParseTests_API_AgentToAgentTestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetTargetAgentId(convert.FrameworkToPtrString(data.TargetAgentID)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetThroughputDuration(convert.FrameworkInt64ToPtrInt32(data.ThroughputDuration)) + body.SetThroughputMeasurements(convert.FrameworkToPtrBool(data.ThroughputMeasurements)) + body.SetThroughputRate(convert.FrameworkInt64ToPtrInt32(data.ThroughputRate)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + agentsRaw, d := expandAgentToAgentAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandAgentToAgentAgents converts the configured AgentToAgentAgentModel values into SDK structs. +func expandAgentToAgentAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []AgentToAgentAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/crud.go new file mode 100644 index 00000000..617a9578 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_agent_to_agent. +func (r *TestsAgentToAgentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsAgentToAgentResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().AgentToAgent().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_agent_to_agent state from the API. +func (r *TestsAgentToAgentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsAgentToAgentResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_agent_to_agent and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsAgentToAgentResource) readState( + ctx context.Context, + state *TestsAgentToAgentResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().AgentToAgent().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsAgentToAgentResource) readAfterWrite( + ctx context.Context, + state *TestsAgentToAgentResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_agent_to_agent. +func (r *TestsAgentToAgentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsAgentToAgentResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().AgentToAgent().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_agent_to_agent. +func (r *TestsAgentToAgentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsAgentToAgentResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().AgentToAgent().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/model.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/model.go new file mode 100644 index 00000000..01ca73fa --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/model.go @@ -0,0 +1,65 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsAgentToAgentResourceModel is the Terraform state for a thousandeyes_tests_agent_to_agent. +// +// Field order follows the schema, and the timeouts value is last. +type TestsAgentToAgentResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + Direction types.String `tfsdk:"direction"` + Dscp types.String `tfsdk:"dscp"` + DscpID types.String `tfsdk:"dscp_id"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + Mss types.Int64 `tfsdk:"mss"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + Port types.Int64 `tfsdk:"port"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + TargetAgentID types.String `tfsdk:"target_agent_id"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + ThroughputDuration types.Int64 `tfsdk:"throughput_duration"` + ThroughputMeasurements types.Bool `tfsdk:"throughput_measurements"` + ThroughputRate types.Int64 `tfsdk:"throughput_rate"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// AgentToAgentAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type AgentToAgentAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// agentToAgentAgentAttrTypes describes AgentToAgentAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var agentToAgentAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var agentToAgentAgentObjectType = types.ObjectType{AttrTypes: agentToAgentAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/resource.go new file mode 100644 index 00000000..d35439d5 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/resource.go @@ -0,0 +1,267 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_agent_to_agent" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsAgentToAgentResource)(nil) + _ resource.ResourceWithConfigure = (*TestsAgentToAgentResource)(nil) + _ resource.ResourceWithImportState = (*TestsAgentToAgentResource)(nil) +) + +// NewTestsAgentToAgentResource returns the thousandeyes_tests_agent_to_agent resource. +func NewTestsAgentToAgentResource() resource.Resource { + return &TestsAgentToAgentResource{} +} + +// TestsAgentToAgentResource implements the thousandeyes_tests_agent_to_agent resource. +type TestsAgentToAgentResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsAgentToAgentResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsAgentToAgentResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsAgentToAgentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsAgentToAgentResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get Agent to Agent test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates if alerts are enabled.", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "direction": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Direction of the test, which affects how results are shown. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("to-target", "from-target", "bidirectional"), + }, + }, + "dscp": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "DSCP label.", + }, + "dscp_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "DSCP ID [to see list for acceptable " + + "values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) " + + " The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "8", "16", "24", "32", "40", "48", "56", "10", "12", "14", "18", "20", "22", "26", "28", "30", "34", "36", "38", "46", "44"), + }, + }, + "enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Test is enabled. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mss": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Maximum segment size, in bytes.", + Validators: []validator.Int64{ + int64validator.Between(20, 1400), + }, + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Number of path traces executed by the agent. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "port": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Target port. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 65535), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + MarkdownDescription: " The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "target_agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "`agentId` of the target agent for the test.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The name of the test. Test name must be unique.", + }, + "throughput_duration": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "The throughput duration.", + Validators: []validator.Int64{ + int64validator.Between(5000, 30000), + }, + }, + "throughput_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Enable or disable throughput measurements. Throughput measurements cannot be enabled when " + + "the source or target of the test is a cloud agent.", + }, + "throughput_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "The throughput rate, only applicable for UDP protocol.", + Validators: []validator.Int64{ + int64validator.Between(8, 1000), + }, + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state.", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/state.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/state.go new file mode 100644 index 00000000..8054dab5 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/state.go @@ -0,0 +1,59 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsAgentToAgentResourceModel, remote models.Tests_API_AgentToAgentTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.Direction = convert.PtrStringerToFramework(remote.GetDirection()) + data.Dscp = convert.PtrStringToFramework(remote.GetDscp()) + data.DscpID = convert.PtrStringerToFramework(remote.GetDscpId()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FixedPacketRate = convert.PtrInt32ToFrameworkInt64(remote.GetFixedPacketRate()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.Mss = convert.PtrInt32ToFrameworkInt64(remote.GetMss()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.Port = convert.PtrInt32ToFrameworkInt64(remote.GetPort()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.TargetAgentID = convert.PtrStringToFramework(remote.GetTargetAgentId()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.ThroughputDuration = convert.PtrInt32ToFrameworkInt64(remote.GetThroughputDuration()) + data.ThroughputMeasurements = convert.PtrBoolToFramework(remote.GetThroughputMeasurements()) + data.ThroughputRate = convert.PtrInt32ToFrameworkInt64(remote.GetThroughputRate()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/test_helper_test.go new file mode 100644 index 00000000..d12c0c38 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_agent_tests/v7/tests_agent_to_agent/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_agent + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsAgentToAgentTestResource answers whether a thousandeyes_tests_agent_to_agent is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsAgentToAgentTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsAgentToAgentTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().AgentToAgent().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/construct.go new file mode 100644 index 00000000..f3878f36 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/construct.go @@ -0,0 +1,94 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsAgentToServerResourceModel) (*models.Tests_API_AgentToServerTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_AgentToServerTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetContinuousMode(convert.FrameworkToPtrBool(data.ContinuousMode)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + dscpIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDscpId](data.DscpID, models.ParseTests_API_TestDscpId) + diags.Append(d...) + body.SetDscpId(dscpIDRaw) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + ipv6PolicyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestIpv6Policy](data.Ipv6Policy, models.ParseTests_API_TestIpv6Policy) + diags.Append(d...) + body.SetIpv6Policy(ipv6PolicyRaw) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNetworkMeasurements(convert.FrameworkToPtrBool(data.NetworkMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + body.SetPingPayloadSize(convert.FrameworkInt64ToPtrInt32(data.PingPayloadSize)) + body.SetPort(convert.FrameworkInt64ToPtrInt32(data.Port)) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetServer(convert.FrameworkToPtrString(data.Server)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + agentsRaw, d := expandAgentToServerAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandAgentToServerAgents converts the configured AgentToServerAgentModel values into SDK structs. +func expandAgentToServerAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []AgentToServerAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/crud.go new file mode 100644 index 00000000..909d5c8e --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/crud.go @@ -0,0 +1,237 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_agent_to_server. +func (r *TestsAgentToServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsAgentToServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().AgentToServer().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_agent_to_server state from the API. +func (r *TestsAgentToServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsAgentToServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_agent_to_server and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsAgentToServerResource) readState( + ctx context.Context, + state *TestsAgentToServerResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().AgentToServer().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsAgentToServerResource) readAfterWrite( + ctx context.Context, + state *TestsAgentToServerResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update satisfies the resource interface for an API that has no update operation. +// +// Every writable attribute carries RequiresReplace, so Terraform plans a replacement for +// any change and this method is never invoked. Reaching it means a writable attribute is +// missing the modifier, which is a generator bug rather than a runtime condition, and it +// says so instead of guessing at an update the API cannot perform. +func (r *TestsAgentToServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + resp.Diagnostics.AddError( + "Update is not supported by the API", + "Every change to thousandeyes_tests_agent_to_server forces replacement, so Terraform should never "+ + "have called Update. This is a bug in the provider; please report it.", + ) +} + +// Delete removes a thousandeyes_tests_agent_to_server. +func (r *TestsAgentToServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsAgentToServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().AgentToServer().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/model.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/model.go new file mode 100644 index 00000000..6e6dca0f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/model.go @@ -0,0 +1,67 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsAgentToServerResourceModel is the Terraform state for a thousandeyes_tests_agent_to_server. +// +// Field order follows the schema, and the timeouts value is last. +type TestsAgentToServerResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + ContinuousMode types.Bool `tfsdk:"continuous_mode"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + Dscp types.String `tfsdk:"dscp"` + DscpID types.String `tfsdk:"dscp_id"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + Interval types.Int64 `tfsdk:"interval"` + Ipv6Policy types.String `tfsdk:"ipv6_policy"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + PingPayloadSize types.Int64 `tfsdk:"ping_payload_size"` + Port types.Int64 `tfsdk:"port"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + Server types.String `tfsdk:"server"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// AgentToServerAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type AgentToServerAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// agentToServerAgentAttrTypes describes AgentToServerAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var agentToServerAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var agentToServerAgentObjectType = types.ObjectType{AttrTypes: agentToServerAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource.go new file mode 100644 index 00000000..0fa24f85 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource.go @@ -0,0 +1,454 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/int64planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/setplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_agent_to_server" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsAgentToServerResource)(nil) + _ resource.ResourceWithConfigure = (*TestsAgentToServerResource)(nil) + _ resource.ResourceWithImportState = (*TestsAgentToServerResource)(nil) +) + +// NewTestsAgentToServerResource returns the thousandeyes_tests_agent_to_server resource. +func NewTestsAgentToServerResource() resource.Resource { + return &TestsAgentToServerResource{} +} + +// TestsAgentToServerResource implements the thousandeyes_tests_agent_to_server resource. +type TestsAgentToServerResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsAgentToServerResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsAgentToServerResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsAgentToServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsAgentToServerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get Agent to Server test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Observed: the API assigns false when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "continuous_mode": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "To enable continuous monitoring, set this parameter to `true` to. When continuous " + + "monitoring is enabled, the following actions occur: * `fixedPacketRate` is enforced * " + + "`bandwidthMeasurements` are disabled * If the `protocol` is set to `tcp`, `probeMode` is " + + "set to `syn`. Observed: the API assigns false when " + + "this is omitted. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "dscp": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "DSCP label.", + }, + "dscp_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "DSCP ID [to see list for acceptable " + + "values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "8", "16", "24", "32", "40", "48", "56", "10", "12", "14", "18", "20", "22", "26", "28", "30", "34", "36", "38", "46", "44"), + }, + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "If continuousMode is `false`, set the fixedPacketRate to a value between 10-100. If " + + "`continuousMode` is `true`, set the `fixedPacketRate` to `1`", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + PlanModifiers: []planmodifier.Int64{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + int64planmodifier.RequiresReplace(), + }, + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + PlanModifiers: []planmodifier.Int64{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + int64planmodifier.RequiresReplace(), + }, + }, + "ipv6_policy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("force-ipv4", "prefer-ipv6", "force-ipv6", "use-agent-policy"), + }, + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "network_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "View packet loss in 1-second intervals. This is only available for 1-minute interval " + + "tests. Set to `true` to enable network measurements. " + + "Observed: the API assigns true when this is omitted. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Observed: the API assigns 3 when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + PlanModifiers: []planmodifier.Int64{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + int64planmodifier.RequiresReplace(), + }, + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "ping_payload_size": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Payload size (not total packet size) for the end-to-end metric's probes, ping payload size " + + "allows values from 0 to 1400 bytes. When set to null, payload sizes are 0 bytes for " + + "ICMP-based tests and 1 byte for TCP-based tests.", + Validators: []validator.Int64{ + int64validator.Between(0, 1400), + }, + PlanModifiers: []planmodifier.Int64{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + int64planmodifier.RequiresReplace(), + }, + }, + "port": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Port number to use for the test. The default port is 80.", + PlanModifiers: []planmodifier.Int64{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + int64planmodifier.RequiresReplace(), + }, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "server": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The target name or IP address. If a port is set for the test, it is appended to the target " + + "name or IP address using a colon. The test's target: the API refuses a create without it, " + + "whatever the specification marks. The API enforces " + + "this field's presence, which the specification does not declare. The API " + + "normalises this value (appends the port, www.example.com becomes www.example.com:80; the " + + "2026-08-03 acceptance run (#13)); state carries the configured form.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the " + + "specification does not declare. ", + PlanModifiers: []planmodifier.Set{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + setplanmodifier.RequiresReplace(), + }, + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource_acceptance_test.go new file mode 100644 index 00000000..3924fd14 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/resource_acceptance_test.go @@ -0,0 +1,128 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_agent_to_server.test" + +var testResource = tests_agent_to_server.TestsAgentToServerTestResource{} + +// TestAccResourceTestsAgentToServer_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsAgentToServer_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_agent_to_server", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").HasValue("false"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("continuous_mode").HasValue("false"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // port: it is write-only, carried from configuration, which an import does not have + // server: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"port", "server", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("continuous_mode").HasValue("false"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("dscp_id").HasValue("0"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("fixed_packet_rate").Exists(), + check.That(address).Key("interval").Exists(), + check.That(address).Key("ipv6_policy").HasValue("force-ipv4"), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("ping_payload_size").HasValue("1"), + check.That(address).Key("port").HasValue("1"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/state.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/state.go new file mode 100644 index 00000000..9169d5c3 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/state.go @@ -0,0 +1,59 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsAgentToServerResourceModel, remote models.Tests_API_AgentToServerTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.ContinuousMode = convert.PtrBoolToFramework(remote.GetContinuousMode()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.Dscp = convert.PtrStringToFramework(remote.GetDscp()) + data.DscpID = convert.PtrStringerToFramework(remote.GetDscpId()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FixedPacketRate = convert.PtrInt32ToFrameworkInt64(remote.GetFixedPacketRate()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.Ipv6Policy = convert.PtrStringerToFramework(remote.GetIpv6Policy()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.PingPayloadSize = convert.PtrInt32ToFrameworkInt64(remote.GetPingPayloadSize()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/test_helper_test.go new file mode 100644 index 00000000..0190e6b2 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_agent_to_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsAgentToServerTestResource answers whether a thousandeyes_tests_agent_to_server is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsAgentToServerTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsAgentToServerTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().AgentToServer().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/maximal.tf new file mode 100644 index 00000000..59a59541 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/maximal.tf @@ -0,0 +1,77 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_agent_to_server" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # continuous_mode: the API's own default, so a value it is known to accept + # + # dscp_id: documented; unprobed + # + # enabled: the API's own default, so a value it is known to accept + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # ipv6_policy: documented; unprobed + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # network_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # server: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + bandwidth_measurements = false + bgp_measurements = true + continuous_mode = false + description = "tfacc-description" + dscp_id = "0" + enabled = true + fixed_packet_rate = 50 + interval = 3600 + ipv6_policy = "force-ipv4" + mtu_measurements = true + network_measurements = true + num_path_traces = 3 + path_trace_mode = "classic" + ping_payload_size = 1 + port = 1 + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + server = "www.example.com" + test_name = "tfacc-test-name" + use_public_bgp = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/minimal.tf new file mode 100644 index 00000000..6e3f47cc --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/agent_to_server_tests/v7/tests_agent_to_server/testdata/minimal.tf @@ -0,0 +1,24 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_agent_to_server" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # server: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + server = "www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/construct.go index a3b9633f..ce837a6d 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/crud.go index 60d4bd37..43a02bc3 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/model.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/model.go index 9c6401e6..7484ee1c 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource.go index 00c5d48c..a4b817d8 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource_acceptance_test.go index a586164f..582d5623 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/state.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/state.go index b01e4682..ce8416d4 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/test_helper_test.go index 269a9498..88add21c 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package alert_suppression_window diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/maximal.tf index f4dac958..7d3543f1 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/minimal.tf index 70456c46..7caeeeeb 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/alert_suppression_windows/v7/alert_suppression_window/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/construct.go new file mode 100644 index 00000000..ae178c70 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/construct.go @@ -0,0 +1,311 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsAPIResourceModel) (*models.Tests_API_ApiTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_ApiTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetClientCertDomainsAllowList(convert.FrameworkToPtrString(data.ClientCertDomainsAllowList)) + body.SetClientCertificate(convert.FrameworkToPtrString(data.ClientCertificate)) + body.SetCollectProxyNetworkData(convert.FrameworkToPtrBool(data.CollectProxyNetworkData)) + credentialsRaw, d := convert.FrameworkSetToStringSlice(ctx, data.Credentials) + diags.Append(d...) + body.SetCredentials(credentialsRaw) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetDistributedTracing(convert.FrameworkToPtrBool(data.DistributedTracing)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFollowRedirects(convert.FrameworkToPtrBool(data.FollowRedirects)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNetworkMeasurements(convert.FrameworkToPtrBool(data.NetworkMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetOverrideAgentProxy(convert.FrameworkToPtrBool(data.OverrideAgentProxy)) + body.SetOverrideProxyId(convert.FrameworkToPtrString(data.OverrideProxyID)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + predefinedVariablesRaw, d := expandTestsAPIAPIPredefinedVariables(ctx, data.PredefinedVariables) + diags.Append(d...) + body.SetPredefinedVariables(predefinedVariablesRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + requestsRaw, d := expandTestsAPIAPIRequests(ctx, data.Requests) + diags.Append(d...) + body.SetRequests(requestsRaw) + sSLVersionIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestSslVersionId](data.SSLVersionID, models.ParseTests_API_TestSslVersionId) + diags.Append(d...) + body.SetSslVersionId(sSLVersionIDRaw) + body.SetTargetTime(convert.FrameworkInt64ToPtrInt32(data.TargetTime)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetTimeLimit(convert.FrameworkInt64ToPtrInt32(data.TimeLimit)) + body.SetUrl(convert.FrameworkToPtrString(data.URL)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + vaultCredentialsRaw, d := expandTestsAPITestVaultCredentials(ctx, data.VaultCredentials) + diags.Append(d...) + body.SetVaultCredentials(vaultCredentialsRaw) + agentsRaw, d := expandApiAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandTestsAPIAPIPredefinedVariables converts the configured TestsAPIAPIPredefinedVariableModel values into SDK structs. +func expandTestsAPIAPIPredefinedVariables(ctx context.Context, v types.Set) ([]models.Tests_API_ApiPredefinedVariableable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPIAPIPredefinedVariableModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_ApiPredefinedVariableable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_ApiPredefinedVariable() + + item.SetName(convert.FrameworkToPtrString(m.Name)) + item.SetValue(convert.FrameworkToPtrString(m.Value)) + out = append(out, item) + } + + return out, diags +} + +// expandTestsAPIAPIRequests converts the configured TestsAPIAPIRequestModel values into SDK structs. +func expandTestsAPIAPIRequests(ctx context.Context, v types.Set) ([]models.Tests_API_ApiRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPIAPIRequestModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_ApiRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_ApiRequest() + + assertionsRaw, d := expandTestsAPIAPIRequestAssertions(ctx, m.Assertions) + diags.Append(d...) + item.SetAssertions(assertionsRaw) + authTypeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_ApiRequestAuthType](m.AuthType, models.ParseTests_API_ApiRequestAuthType) + diags.Append(d...) + item.SetAuthType(authTypeRaw) + item.SetBearerToken(convert.FrameworkToPtrString(m.BearerToken)) + item.SetBody(convert.FrameworkToPtrString(m.Body)) + clientAuthenticationRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_ApiClientAuthentication](m.ClientAuthentication, models.ParseTests_API_ApiClientAuthentication) + diags.Append(d...) + item.SetClientAuthentication(clientAuthenticationRaw) + item.SetClientId(convert.FrameworkToPtrString(m.ClientID)) + item.SetClientSecret(convert.FrameworkToPtrString(m.ClientSecret)) + item.SetCollectApiResponse(convert.FrameworkToPtrBool(m.CollectAPIResponse)) + headersRaw, d := expandTestsAPIAPIRequestHeaders(ctx, m.Headers) + diags.Append(d...) + item.SetHeaders(headersRaw) + methodRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_ApiRequestMethod](m.Method, models.ParseTests_API_ApiRequestMethod) + diags.Append(d...) + item.SetMethod(methodRaw) + item.SetName(convert.FrameworkToPtrString(m.Name)) + item.SetPassword(convert.FrameworkToPtrString(m.Password)) + item.SetScope(convert.FrameworkToPtrString(m.Scope)) + item.SetTokenUrl(convert.FrameworkToPtrString(m.TokenURL)) + item.SetUrl(convert.FrameworkToPtrString(m.URL)) + item.SetUsername(convert.FrameworkToPtrString(m.Username)) + variablesRaw, d := expandTestsAPIAPIRequestVariables(ctx, m.Variables) + diags.Append(d...) + item.SetVariables(variablesRaw) + item.SetVerifyCertificate(convert.FrameworkToPtrBool(m.VerifyCertificate)) + item.SetWaitTimeMs(convert.FrameworkInt64ToPtrInt32(m.WaitTimeMs)) + out = append(out, item) + } + + return out, diags +} + +// expandTestsAPIAPIRequestAssertions converts the configured TestsAPIAPIRequestAssertionModel values into SDK structs. +func expandTestsAPIAPIRequestAssertions(ctx context.Context, v types.Set) ([]models.Tests_API_ApiRequestAssertionable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPIAPIRequestAssertionModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_ApiRequestAssertionable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_ApiRequestAssertion() + + nameRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_ApiRequestAssertionName](m.Name, models.ParseTests_API_ApiRequestAssertionName) + diags.Append(d...) + item.SetName(nameRaw) + operatorRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_ApiRequestAssertionOperator](m.Operator, models.ParseTests_API_ApiRequestAssertionOperator) + diags.Append(d...) + item.SetOperator(operatorRaw) + item.SetValue(convert.FrameworkToPtrString(m.Value)) + out = append(out, item) + } + + return out, diags +} + +// expandTestsAPIAPIRequestHeaders converts the configured TestsAPIAPIRequestHeaderModel values into SDK structs. +func expandTestsAPIAPIRequestHeaders(ctx context.Context, v types.Set) ([]models.Tests_API_ApiRequestHeaderable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPIAPIRequestHeaderModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_ApiRequestHeaderable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_ApiRequestHeader() + + item.SetKey(convert.FrameworkToPtrString(m.Key)) + item.SetValue(convert.FrameworkToPtrString(m.Value)) + out = append(out, item) + } + + return out, diags +} + +// expandTestsAPIAPIRequestVariables converts the configured TestsAPIAPIRequestVariableModel values into SDK structs. +func expandTestsAPIAPIRequestVariables(ctx context.Context, v types.Set) ([]models.Tests_API_ApiRequestVariableable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPIAPIRequestVariableModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_ApiRequestVariableable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_ApiRequestVariable() + + item.SetName(convert.FrameworkToPtrString(m.Name)) + item.SetValue(convert.FrameworkToPtrString(m.Value)) + out = append(out, item) + } + + return out, diags +} + +// expandTestsAPITestVaultCredentials converts the configured TestsAPITestVaultCredentialModel values into SDK structs. +func expandTestsAPITestVaultCredentials(ctx context.Context, v types.Set) ([]models.Tests_API_TestVaultCredentialable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsAPITestVaultCredentialModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestVaultCredentialable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestVaultCredential() + + item.SetSecretId(convert.FrameworkToPtrString(m.SecretID)) + targetRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestVaultCredentialTarget](m.Target, models.ParseTests_API_TestVaultCredentialTarget) + diags.Append(d...) + item.SetTarget(targetRaw) + out = append(out, item) + } + + return out, diags +} + +// expandApiAgents converts the configured ApiAgentModel values into SDK structs. +func expandApiAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []ApiAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/crud.go new file mode 100644 index 00000000..a094ab4f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_api. +func (r *TestsAPIResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsAPIResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().Api().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_api state from the API. +func (r *TestsAPIResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsAPIResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_api and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsAPIResource) readState( + ctx context.Context, + state *TestsAPIResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().Api().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + diags.Append(mapRemoteStateToTerraform(ctx, state, remote)...) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsAPIResource) readAfterWrite( + ctx context.Context, + state *TestsAPIResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_api. +func (r *TestsAPIResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsAPIResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().Api().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_api. +func (r *TestsAPIResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsAPIResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().Api().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/model.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/model.go new file mode 100644 index 00000000..024828a8 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/model.go @@ -0,0 +1,229 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsAPIResourceModel is the Terraform state for a thousandeyes_tests_api. +// +// Field order follows the schema, and the timeouts value is last. +type TestsAPIResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + ClientCertDomainsAllowList types.String `tfsdk:"client_cert_domains_allow_list"` + ClientCertificate types.String `tfsdk:"client_certificate"` + CollectProxyNetworkData types.Bool `tfsdk:"collect_proxy_network_data"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Credentials types.Set `tfsdk:"credentials"` + Description types.String `tfsdk:"description"` + DistributedTracing types.Bool `tfsdk:"distributed_tracing"` + Enabled types.Bool `tfsdk:"enabled"` + FollowRedirects types.Bool `tfsdk:"follow_redirects"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + OverrideAgentProxy types.Bool `tfsdk:"override_agent_proxy"` + OverrideProxyID types.String `tfsdk:"override_proxy_id"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + PredefinedVariables types.Set `tfsdk:"predefined_variables"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + Requests types.Set `tfsdk:"requests"` + SavedEvent types.Bool `tfsdk:"saved_event"` + SSLVersionID types.String `tfsdk:"ssl_version_id"` + TargetTime types.Int64 `tfsdk:"target_time"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + TimeLimit types.Int64 `tfsdk:"time_limit"` + Type types.String `tfsdk:"type"` + URL types.String `tfsdk:"url"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + VaultCredentials types.Set `tfsdk:"vault_credentials"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// TestsAPIAPIPredefinedVariableModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPIAPIPredefinedVariableModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} + +// testsApiapiPredefinedVariableAttrTypes describes TestsAPIAPIPredefinedVariableModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsApiapiPredefinedVariableAttrTypes = map[string]attr.Type{ + "name": types.StringType, + "value": types.StringType, +} + +var testsApiapiPredefinedVariableObjectType = types.ObjectType{AttrTypes: testsApiapiPredefinedVariableAttrTypes} + +// TestsAPIAPIRequestModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPIAPIRequestModel struct { + Assertions types.Set `tfsdk:"assertions"` + AuthType types.String `tfsdk:"auth_type"` + BearerToken types.String `tfsdk:"bearer_token"` + Body types.String `tfsdk:"body"` + ClientAuthentication types.String `tfsdk:"client_authentication"` + ClientID types.String `tfsdk:"client_id"` + ClientSecret types.String `tfsdk:"client_secret"` + CollectAPIResponse types.Bool `tfsdk:"collect_api_response"` + Headers types.Set `tfsdk:"headers"` + Method types.String `tfsdk:"method"` + Name types.String `tfsdk:"name"` + Password types.String `tfsdk:"password"` + Scope types.String `tfsdk:"scope"` + TokenURL types.String `tfsdk:"token_url"` + URL types.String `tfsdk:"url"` + Username types.String `tfsdk:"username"` + Variables types.Set `tfsdk:"variables"` + VerifyCertificate types.Bool `tfsdk:"verify_certificate"` + WaitTimeMs types.Int64 `tfsdk:"wait_time_ms"` +} + +// testsApiapiRequestAttrTypes describes TestsAPIAPIRequestModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsApiapiRequestAttrTypes = map[string]attr.Type{ + "assertions": types.SetType{ElemType: testsApiapiRequestAssertionObjectType}, + "auth_type": types.StringType, + "bearer_token": types.StringType, + "body": types.StringType, + "client_authentication": types.StringType, + "client_id": types.StringType, + "client_secret": types.StringType, + "collect_api_response": types.BoolType, + "headers": types.SetType{ElemType: testsApiapiRequestHeaderObjectType}, + "method": types.StringType, + "name": types.StringType, + "password": types.StringType, + "scope": types.StringType, + "token_url": types.StringType, + "url": types.StringType, + "username": types.StringType, + "variables": types.SetType{ElemType: testsApiapiRequestVariableObjectType}, + "verify_certificate": types.BoolType, + "wait_time_ms": types.Int64Type, +} + +var testsApiapiRequestObjectType = types.ObjectType{AttrTypes: testsApiapiRequestAttrTypes} + +// TestsAPIAPIRequestAssertionModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPIAPIRequestAssertionModel struct { + Name types.String `tfsdk:"name"` + Operator types.String `tfsdk:"operator"` + Value types.String `tfsdk:"value"` +} + +// testsApiapiRequestAssertionAttrTypes describes TestsAPIAPIRequestAssertionModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsApiapiRequestAssertionAttrTypes = map[string]attr.Type{ + "name": types.StringType, + "operator": types.StringType, + "value": types.StringType, +} + +var testsApiapiRequestAssertionObjectType = types.ObjectType{AttrTypes: testsApiapiRequestAssertionAttrTypes} + +// TestsAPIAPIRequestHeaderModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPIAPIRequestHeaderModel struct { + Key types.String `tfsdk:"key"` + Value types.String `tfsdk:"value"` +} + +// testsApiapiRequestHeaderAttrTypes describes TestsAPIAPIRequestHeaderModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsApiapiRequestHeaderAttrTypes = map[string]attr.Type{ + "key": types.StringType, + "value": types.StringType, +} + +var testsApiapiRequestHeaderObjectType = types.ObjectType{AttrTypes: testsApiapiRequestHeaderAttrTypes} + +// TestsAPIAPIRequestVariableModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPIAPIRequestVariableModel struct { + Name types.String `tfsdk:"name"` + Value types.String `tfsdk:"value"` +} + +// testsApiapiRequestVariableAttrTypes describes TestsAPIAPIRequestVariableModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsApiapiRequestVariableAttrTypes = map[string]attr.Type{ + "name": types.StringType, + "value": types.StringType, +} + +var testsApiapiRequestVariableObjectType = types.ObjectType{AttrTypes: testsApiapiRequestVariableAttrTypes} + +// TestsAPITestVaultCredentialModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsAPITestVaultCredentialModel struct { + SecretID types.String `tfsdk:"secret_id"` + Target types.String `tfsdk:"target"` +} + +// testsAPITestVaultCredentialAttrTypes describes TestsAPITestVaultCredentialModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsAPITestVaultCredentialAttrTypes = map[string]attr.Type{ + "secret_id": types.StringType, + "target": types.StringType, +} + +var testsAPITestVaultCredentialObjectType = types.ObjectType{AttrTypes: testsAPITestVaultCredentialAttrTypes} + +// ApiAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type ApiAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// apiAgentAttrTypes describes ApiAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var apiAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var apiAgentObjectType = types.ObjectType{AttrTypes: apiAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource.go new file mode 100644 index 00000000..1d93f7da --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource.go @@ -0,0 +1,552 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_api" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsAPIResource)(nil) + _ resource.ResourceWithConfigure = (*TestsAPIResource)(nil) + _ resource.ResourceWithImportState = (*TestsAPIResource)(nil) +) + +// NewTestsAPIResource returns the thousandeyes_tests_api resource. +func NewTestsAPIResource() resource.Resource { + return &TestsAPIResource{} +} + +// TestsAPIResource implements the thousandeyes_tests_api resource. +type TestsAPIResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsAPIResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsAPIResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsAPIResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsAPIResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get API test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "client_cert_domains_allow_list": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Comma separated list of domains to send the client certificate.", + }, + "client_certificate": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "String representation (containing newline characters) of client certificate, the private " + + "key must be placed first, then the certificate. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "collect_proxy_network_data": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether network data to the proxy should be collected. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "credentials": schema.SetAttribute{ + ElementType: types.StringType, + Optional: true, + MarkdownDescription: "Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "distributed_tracing": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted from " + + "an update. Omitting this field from an update resets it rather than preserving the stored " + + "value. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "follow_redirects": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to " + + "`false`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) " + + "observed the API applying its own value when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. " + + "Neither the update response nor a read returns this field: it is write-only in practice, " + + "and state carries the configured value. ", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Conditionally, when networkMeasurements is \"false\": round-trips alone, and is stored as " + + "null the moment \"networkMeasurements\" rides along; isolated by bisecting the maximal " + + "body's delta. Not applied to the schema, because this holds only under that condition and " + + "the schema has no way to say so. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "override_agent_proxy": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Flag indicating if a proxy other than the default should be used. To override the default " + + "proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "override_proxy_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "ID of the proxy to be used if the default proxy is overridden. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "predefined_variables": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Variable name. Must be unique.", + }, + "value": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Variable value, will be treated as string.", + }, + }, + }, + Optional: true, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "requests": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "assertions": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Set to `status-code` to assert the response status code. Set to `response-body` to assert " + + "data is present in the response body. Use `ApiRequestAssertion` to set the value for the " + + "assertion. Values accepted here: `status-code`, " + + "`response-body`. The API accepted a value from outside the documented set, so no OneOf " + + "validator is generated for this attribute. ", + }, + "operator": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "If `name = status-code``, accepted values are [is, is-not]. If `name = response-body``, " + + "accepted values are [includes, not-includes, matches, not-matches]`. Values accepted here: `is`, `is-not`, `includes`, " + + "`not-includes`, `matches`, `not-matches`. The API accepted a value from outside the " + + "documented set, so no OneOf validator is generated for this attribute. ", + }, + "value": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The value of the assertion. If name = `status-code`, the status code to assert. If name = " + + "`response-body`, the lookup value to assert.", + }, + }, + }, + Optional: true, + MarkdownDescription: "List of assertion objects.", + }, + "auth_type": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Will override the Authorization request header. " + + "Values accepted here: `none`, `basic`, `bearer-token`, `oauth2`. Observed: the API assigns " + + "\"none\" when this is omitted. The API accepted a value from outside the documented set, so " + + "no OneOf validator is generated for this attribute. ", + }, + "bearer_token": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The bearer token if `authType = bearer-token`.", + }, + "body": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "POST/PUT request body. Must be in JSON format.", + }, + "client_authentication": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The OAuth2 client authentication location type. " + + "Values accepted here: `basic-auth-header`, `in-body`. The API accepted a value from " + + "outside the documented set, so no OneOf validator is generated for this attribute. ", + }, + "client_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The application ID used when `authType` is set to \"oauth2\".", + }, + "client_secret": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The private client secret used when `authType` is set to \"oauth2\".", + }, + "collect_api_response": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` if API response body should be collected and saved. Set to `false` if API " + + "response body should not be saved. Observed: the API " + + "assigns false when this is omitted. ", + }, + "headers": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "key": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Request header key.", + }, + "value": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Request header value. Supports variables `{{variableName}}`.", + }, + }, + }, + Optional: true, + MarkdownDescription: "Array of API Request Header objects.", + }, + "method": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP request method. Values accepted here: `get`, " + + "`post`, `put`, `delete`, `patch`. Observed: the API assigns \"get\" when this is omitted. " + + "The API accepted a value from outside the documented set, so no OneOf validator is " + + "generated for this attribute. ", + }, + "name": schema.StringAttribute{ + Required: true, + MarkdownDescription: "API step name, must be unique. Observed: the API " + + "assigns \"step-1\" when this is omitted. ", + }, + "password": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The password if `authType = basic`.", + }, + "scope": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Application-specific scope values for the access token when `authType` is \"oauth2\".", + }, + "token_url": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The endpoint used to request the access token when `authType` is \"oauth2\".", + }, + "url": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Request url. Supports variables in the format `{{variableName}}`. Observed: the API assigns " + + "\"https://api.stripe.com/healthcheck\" when this is omitted. ", + }, + "username": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The username if `authType = basic`.", + }, + "variables": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Variable name", + }, + "value": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The JSON path of data within the Response Body to assign to this variable.", + }, + }, + }, + Optional: true, + MarkdownDescription: "Array of API post request variable objects.", + }, + "verify_certificate": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns false when this is omitted. " + + "", + }, + "wait_time_ms": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Post request delay before executing the next API requests, in milliseconds.", + }, + }, + }, + Required: true, + MarkdownDescription: " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "ssl_version_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for " + + "TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "3", "4", "5", "6", "7"), + }, + }, + "target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for completion metric, defaults to 50% of time limit specified in seconds. (0 " + + "means default behavior) Observed: the API assigns 6 " + + "when this is omitted. ", + Validators: []validator.Int64{ + int64validator.Between(0, 60), + }, + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Time limit for transaction in seconds. Exceeding this limit will result in a Timeout " + + "error. Observed: the API assigns 10 when this is " + + "omitted. ", + Validators: []validator.Int64{ + int64validator.Between(5, 180), + }, + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "url": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Target for the test. The test's target: the API refuses a create without it, whatever the " + + "specification marks. The API enforces this field's " + + "presence, which the specification does not declare. ", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "vault_credentials": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "secret_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "UUID of the configured secret.", + }, + "target": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The target setting that the credential should be used for. Values accepted here: `username`, `password`, `script`. " + + "The API accepted a value from outside the documented set, so no OneOf validator is " + + "generated for this attribute. ", + }, + }, + }, + Optional: true, + Computed: true, + MarkdownDescription: "List of credential IDs that are stored in an external vault. Computed as well as optional: " + + "the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value " + + "when this is omitted.", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource_acceptance_test.go new file mode 100644 index 00000000..456d2172 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/resource_acceptance_test.go @@ -0,0 +1,131 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_api.test" + +var testResource = tests_api.TestsAPITestResource{} + +// TestAccResourceTestsAPI_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsAPI_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_api", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("collect_proxy_network_data").HasValue("false"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("target_time").HasValue("6"), + check.That(address).Key("time_limit").HasValue("10"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // follow_redirects: the API never returns it, so it is absent after an import + // num_path_traces: the API never returns it, so it is absent after an import + // ssl_version_id: the API never returns it, so it is absent after an import + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"follow_redirects", "num_path_traces", "ssl_version_id", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("client_cert_domains_allow_list").HasValue("tfacc-client-cert-domains-allow-list"), + check.That(address).Key("collect_proxy_network_data").HasValue("false"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("target_time").HasValue("6"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("time_limit").HasValue("10"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/state.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/state.go new file mode 100644 index 00000000..c5be8112 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/state.go @@ -0,0 +1,270 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsAPIResourceModel, remote models.Tests_API_ApiTestResponseable) diag.Diagnostics { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return diags + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.ClientCertDomainsAllowList = convert.PtrStringToFramework(remote.GetClientCertDomainsAllowList()) + data.ClientCertificate = convert.PtrStringToFramework(remote.GetClientCertificate()) + data.CollectProxyNetworkData = convert.PtrBoolToFramework(remote.GetCollectProxyNetworkData()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Credentials, d = convert.StringSliceToFrameworkSet(ctx, remote.GetCredentials()) + diags.Append(d...) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DistributedTracing = convert.PtrBoolToFramework(remote.GetDistributedTracing()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + // follow_redirects is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.FollowRedirects.IsUnknown() { + data.FollowRedirects = types.BoolNull() + } + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + // num_path_traces is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.NumPathTraces.IsUnknown() { + data.NumPathTraces = types.Int64Null() + } + data.OverrideAgentProxy = convert.PtrBoolToFramework(remote.GetOverrideAgentProxy()) + data.OverrideProxyID = convert.PtrStringToFramework(remote.GetOverrideProxyId()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.PredefinedVariables, d = flattenTestsAPIAPIPredefinedVariables(ctx, remote.GetPredefinedVariables()) + diags.Append(d...) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.Requests, d = flattenTestsAPIAPIRequests(ctx, remote.GetRequests()) + diags.Append(d...) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + // ssl_version_id is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.SSLVersionID.IsUnknown() { + data.SSLVersionID = types.StringNull() + } + data.TargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetTargetTime()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.TimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetTimeLimit()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.URL = convert.PtrStringToFramework(remote.GetUrl()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + data.VaultCredentials, d = flattenTestsAPITestVaultCredentials(ctx, remote.GetVaultCredentials()) + diags.Append(d...) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) + + return diags +} + +// flattenTestsAPIAPIPredefinedVariables converts SDK structs into the framework value state holds. +func flattenTestsAPIAPIPredefinedVariables(ctx context.Context, in []models.Tests_API_ApiPredefinedVariableable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsApiapiPredefinedVariableObjectType), diags + } + + elements := make([]TestsAPIAPIPredefinedVariableModel, 0, len(in)) + for _, item := range in { + var m TestsAPIAPIPredefinedVariableModel + + m.Name = convert.PtrStringToFramework(item.GetName()) + m.Value = convert.PtrStringToFramework(item.GetValue()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsApiapiPredefinedVariableObjectType, elements) + diags.Append(d2...) + + return out, diags +} + +// flattenTestsAPIAPIRequests converts SDK structs into the framework value state holds. +func flattenTestsAPIAPIRequests(ctx context.Context, in []models.Tests_API_ApiRequestable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + var d diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsApiapiRequestObjectType), diags + } + + elements := make([]TestsAPIAPIRequestModel, 0, len(in)) + for _, item := range in { + var m TestsAPIAPIRequestModel + + m.Assertions, d = flattenTestsAPIAPIRequestAssertions(ctx, item.GetAssertions()) + diags.Append(d...) + m.AuthType = convert.PtrStringerToFramework(item.GetAuthType()) + m.BearerToken = convert.PtrStringToFramework(item.GetBearerToken()) + m.Body = convert.PtrStringToFramework(item.GetBody()) + m.ClientAuthentication = convert.PtrStringerToFramework(item.GetClientAuthentication()) + m.ClientID = convert.PtrStringToFramework(item.GetClientId()) + m.ClientSecret = convert.PtrStringToFramework(item.GetClientSecret()) + m.CollectAPIResponse = convert.PtrBoolToFramework(item.GetCollectApiResponse()) + m.Headers, d = flattenTestsAPIAPIRequestHeaders(ctx, item.GetHeaders()) + diags.Append(d...) + m.Method = convert.PtrStringerToFramework(item.GetMethod()) + m.Name = convert.PtrStringToFramework(item.GetName()) + m.Password = convert.PtrStringToFramework(item.GetPassword()) + m.Scope = convert.PtrStringToFramework(item.GetScope()) + m.TokenURL = convert.PtrStringToFramework(item.GetTokenUrl()) + m.URL = convert.PtrStringToFramework(item.GetUrl()) + m.Username = convert.PtrStringToFramework(item.GetUsername()) + m.Variables, d = flattenTestsAPIAPIRequestVariables(ctx, item.GetVariables()) + diags.Append(d...) + m.VerifyCertificate = convert.PtrBoolToFramework(item.GetVerifyCertificate()) + m.WaitTimeMs = convert.PtrInt32ToFrameworkInt64(item.GetWaitTimeMs()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsApiapiRequestObjectType, elements) + diags.Append(d2...) + + return out, diags +} + +// flattenTestsAPIAPIRequestAssertions converts SDK structs into the framework value state holds. +func flattenTestsAPIAPIRequestAssertions(ctx context.Context, in []models.Tests_API_ApiRequestAssertionable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsApiapiRequestAssertionObjectType), diags + } + + elements := make([]TestsAPIAPIRequestAssertionModel, 0, len(in)) + for _, item := range in { + var m TestsAPIAPIRequestAssertionModel + + m.Name = convert.PtrStringerToFramework(item.GetName()) + m.Operator = convert.PtrStringerToFramework(item.GetOperator()) + m.Value = convert.PtrStringToFramework(item.GetValue()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsApiapiRequestAssertionObjectType, elements) + diags.Append(d2...) + + return out, diags +} + +// flattenTestsAPIAPIRequestHeaders converts SDK structs into the framework value state holds. +func flattenTestsAPIAPIRequestHeaders(ctx context.Context, in []models.Tests_API_ApiRequestHeaderable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsApiapiRequestHeaderObjectType), diags + } + + elements := make([]TestsAPIAPIRequestHeaderModel, 0, len(in)) + for _, item := range in { + var m TestsAPIAPIRequestHeaderModel + + m.Key = convert.PtrStringToFramework(item.GetKey()) + m.Value = convert.PtrStringToFramework(item.GetValue()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsApiapiRequestHeaderObjectType, elements) + diags.Append(d2...) + + return out, diags +} + +// flattenTestsAPIAPIRequestVariables converts SDK structs into the framework value state holds. +func flattenTestsAPIAPIRequestVariables(ctx context.Context, in []models.Tests_API_ApiRequestVariableable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsApiapiRequestVariableObjectType), diags + } + + elements := make([]TestsAPIAPIRequestVariableModel, 0, len(in)) + for _, item := range in { + var m TestsAPIAPIRequestVariableModel + + m.Name = convert.PtrStringToFramework(item.GetName()) + m.Value = convert.PtrStringToFramework(item.GetValue()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsApiapiRequestVariableObjectType, elements) + diags.Append(d2...) + + return out, diags +} + +// flattenTestsAPITestVaultCredentials converts SDK structs into the framework value state holds. +func flattenTestsAPITestVaultCredentials(ctx context.Context, in []models.Tests_API_TestVaultCredentialable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsAPITestVaultCredentialObjectType), diags + } + + elements := make([]TestsAPITestVaultCredentialModel, 0, len(in)) + for _, item := range in { + var m TestsAPITestVaultCredentialModel + + m.SecretID = convert.PtrStringToFramework(item.GetSecretId()) + m.Target = convert.PtrStringerToFramework(item.GetTarget()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsAPITestVaultCredentialObjectType, elements) + diags.Append(d2...) + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/test_helper_test.go new file mode 100644 index 00000000..8746ff28 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_api + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsAPITestResource answers whether a thousandeyes_tests_api is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsAPITestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsAPITestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().Api().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/maximal.tf new file mode 100644 index 00000000..c5d6a2e6 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/maximal.tf @@ -0,0 +1,101 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_api" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # collect_proxy_network_data: the API's own default, so a value it is known to accept + # + # distributed_tracing: the API's own default, so a value it is known to accept + # + # enabled: the API's own default, so a value it is known to accept + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # network_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # override_agent_proxy: the API's own default, so a value it is known to accept + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # requests: curated in the blueprint's accFixture; the generator cannot derive it + # + # ssl_version_id: documented; unprobed + # + # target_time: the API's own default, so a value it is known to accept + # + # time_limit: the API's own default, so a value it is known to accept + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + # + # Not filled in, because no correct value could be derived. Each of these is optional, so this + # configuration is valid as it stands -- but it is testing less than it could. + # + # client_certificate: it is credential-shaped, and a generated fixture must not invent values + # that read as secrets; supply one through accFixture if the test needs it + # + # credentials: its elements have no derivable value: it is credential-shaped, and a generated + # fixture must not invent values that read as secrets; supply one through accFixture if the + # test needs it + # + # override_proxy_id: it references an object that must already exist, which a synthesised + # value cannot name; supply one through accFixture if the test has the object + # + # predefined_variables: a nested object's members may be identifiers of objects that must + # already exist, and nothing in the specification says whether they are + # + # vault_credentials: a nested object's members may be identifiers of objects that must already + # exist, and nothing in the specification says whether they are + alerts_enabled = true + bgp_measurements = true + client_cert_domains_allow_list = "tfacc-client-cert-domains-allow-list" + collect_proxy_network_data = false + description = "tfacc-description" + distributed_tracing = false + enabled = true + follow_redirects = true + interval = 3600 + mtu_measurements = true + network_measurements = true + num_path_traces = 3 + override_agent_proxy = false + path_trace_mode = "classic" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + requests = [{ name = "step-1", url = "https://api.stripe.com/healthcheck", method = "get" }] + ssl_version_id = "0" + target_time = 6 + test_name = "tfacc-test-name" + time_limit = 10 + url = "https://api.stripe.com/healthcheck" + use_public_bgp = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/minimal.tf new file mode 100644 index 00000000..7c0d6b6f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/api_tests/v7/tests_api/testdata/minimal.tf @@ -0,0 +1,27 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_api" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # requests: curated in the blueprint's accFixture; the generator cannot derive it + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + requests = [{ name = "step-1", url = "https://api.stripe.com/healthcheck", method = "get" }] + url = "https://api.stripe.com/healthcheck" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/construct.go new file mode 100644 index 00000000..f1213869 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/construct.go @@ -0,0 +1,33 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsBGPResourceModel) *models.Tests_API_BgpTestRequest { + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_BgpTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetIncludeCoveredPrefixes(convert.FrameworkToPtrBool(data.IncludeCoveredPrefixes)) + body.SetPrefix(convert.FrameworkToPtrString(data.Prefix)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + + return body +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/crud.go new file mode 100644 index 00000000..5bbf43ce --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/crud.go @@ -0,0 +1,233 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_bgp. +func (r *TestsBGPResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsBGPResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body := constructResource(ctx, &plan) + + created, err := r.client.Tests().Bgp().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_bgp state from the API. +func (r *TestsBGPResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsBGPResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_bgp and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsBGPResource) readState( + ctx context.Context, + state *TestsBGPResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().Bgp().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsBGPResource) readAfterWrite( + ctx context.Context, + state *TestsBGPResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update satisfies the resource interface for an API that has no update operation. +// +// Every writable attribute carries RequiresReplace, so Terraform plans a replacement for +// any change and this method is never invoked. Reaching it means a writable attribute is +// missing the modifier, which is a generator bug rather than a runtime condition, and it +// says so instead of guessing at an update the API cannot perform. +func (r *TestsBGPResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + resp.Diagnostics.AddError( + "Update is not supported by the API", + "Every change to thousandeyes_tests_bgp forces replacement, so Terraform should never "+ + "have called Update. This is a bug in the provider; please report it.", + ) +} + +// Delete removes a thousandeyes_tests_bgp. +func (r *TestsBGPResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsBGPResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().Bgp().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/model.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/model.go new file mode 100644 index 00000000..c7879c88 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/model.go @@ -0,0 +1,31 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsBGPResourceModel is the Terraform state for a thousandeyes_tests_bgp. +// +// Field order follows the schema, and the timeouts value is last. +type TestsBGPResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + IncludeCoveredPrefixes types.Bool `tfsdk:"include_covered_prefixes"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + Prefix types.String `tfsdk:"prefix"` + SavedEvent types.Bool `tfsdk:"saved_event"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource.go new file mode 100644 index 00000000..76d3fe43 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource.go @@ -0,0 +1,194 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/boolplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_bgp" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsBGPResource)(nil) + _ resource.ResourceWithConfigure = (*TestsBGPResource)(nil) + _ resource.ResourceWithImportState = (*TestsBGPResource)(nil) +) + +// NewTestsBGPResource returns the thousandeyes_tests_bgp resource. +func NewTestsBGPResource() resource.Resource { + return &TestsBGPResource{} +} + +// TestsBGPResource implements the thousandeyes_tests_bgp resource. +type TestsBGPResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsBGPResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsBGPResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsBGPResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsBGPResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get BGP test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "include_covered_prefixes": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if queries for subprefixes detected under this prefix should included. Observed: the API assigns false when this is omitted. " + + "", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "prefix": schema.StringAttribute{ + Required: true, + MarkdownDescription: "a.b.c.d is a network address, with the prefix length defined as e. Prefixes can be any " + + "length from 8 to 24. The API enforces this field's " + + "presence, which the specification does not declare. ", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + PlanModifiers: []planmodifier.String{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + stringplanmodifier.RequiresReplace(), + }, + }, + "type": schema.StringAttribute{ + Computed: true, + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + PlanModifiers: []planmodifier.Bool{ + // RequiresReplace: the API has no update operation, so every change to a + // writable attribute must be applied by replacement. + boolplanmodifier.RequiresReplace(), + }, + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource_acceptance_test.go new file mode 100644 index 00000000..28eaad37 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/resource_acceptance_test.go @@ -0,0 +1,100 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_bgp.test" + +var testResource = tests_bgp.TestsBGPTestResource{} + +// TestAccResourceTestsBGP_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsBGP_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_bgp", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("include_covered_prefixes").HasValue("false"), + check.That(address).Key("prefix").Exists(), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("include_covered_prefixes").HasValue("false"), + check.That(address).Key("prefix").Exists(), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/state.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/state.go new file mode 100644 index 00000000..005f0aa2 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/state.go @@ -0,0 +1,45 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsBGPResourceModel, remote models.Tests_API_BgpTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.IncludeCoveredPrefixes = convert.PtrBoolToFramework(remote.GetIncludeCoveredPrefixes()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.Prefix = convert.PtrStringToFramework(remote.GetPrefix()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/test_helper_test.go new file mode 100644 index 00000000..41c0dc50 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_bgp + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsBGPTestResource answers whether a thousandeyes_tests_bgp is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsBGPTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsBGPTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().Bgp().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/maximal.tf new file mode 100644 index 00000000..a1f8cc07 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/maximal.tf @@ -0,0 +1,32 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_bgp" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # enabled: the API's own default, so a value it is known to accept + # + # include_covered_prefixes: the API's own default, so a value it is known to accept + # + # prefix: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_public_bgp: the API's own default, so a value it is known to accept + alerts_enabled = true + description = "tfacc-description" + enabled = true + include_covered_prefixes = false + prefix = "8.8.8.0/24" + test_name = "tfacc-test-name" + use_public_bgp = true +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/minimal.tf new file mode 100644 index 00000000..74de25f5 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/bgp_tests/v7/tests_bgp/testdata/minimal.tf @@ -0,0 +1,18 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_bgp" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # prefix: curated in the blueprint's accFixture; the generator cannot derive it + prefix = "8.8.8.0/24" +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/construct.go index 92108d21..4e3ccbce 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/crud.go index 3b39f0c6..aa241412 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/model.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/model.go index 3997038d..27967657 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/create-credential/ package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource.go index 8b1f78e7..1afb7af3 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource_acceptance_test.go index ca8ad5ae..379ef3d3 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/state.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/state.go index d0250cd4..39a37f31 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/test_helper_test.go index 452f2ae7..eeda3a08 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package credential diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/maximal.tf index e343229e..72fafd5d 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/minimal.tf index 3c7170b9..a17a5bfb 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/credentials/v7/credential/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/construct.go new file mode 100644 index 00000000..e5ed43fe --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/construct.go @@ -0,0 +1,97 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsDNSServerResourceModel) (*models.Tests_API_DnsServerTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_DnsServerTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + dNSQueryClassRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_DnsQueryClass](data.DNSQueryClass, models.ParseTests_API_DnsQueryClass) + diags.Append(d...) + body.SetDnsQueryClass(dNSQueryClassRaw) + dNSServersRaw, d := convert.FrameworkSetToStringSlice(ctx, data.DNSServers) + diags.Append(d...) + body.SetDnsServers(dNSServersRaw) + dNSTransportProtocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDnsTransportProtocol](data.DNSTransportProtocol, models.ParseTests_API_TestDnsTransportProtocol) + diags.Append(d...) + body.SetDnsTransportProtocol(dNSTransportProtocolRaw) + body.SetDomain(convert.FrameworkToPtrString(data.Domain)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + ipv6PolicyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestIpv6Policy](data.Ipv6Policy, models.ParseTests_API_TestIpv6Policy) + diags.Append(d...) + body.SetIpv6Policy(ipv6PolicyRaw) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetRecursiveQueries(convert.FrameworkToPtrBool(data.RecursiveQueries)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + agentsRaw, d := expandDnsServerAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandDnsServerAgents converts the configured DnsServerAgentModel values into SDK structs. +func expandDnsServerAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []DnsServerAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/crud.go new file mode 100644 index 00000000..25e41e61 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_dns_server. +func (r *TestsDNSServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsDNSServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().DnsServer().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_dns_server state from the API. +func (r *TestsDNSServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsDNSServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_dns_server and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsDNSServerResource) readState( + ctx context.Context, + state *TestsDNSServerResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().DnsServer().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsDNSServerResource) readAfterWrite( + ctx context.Context, + state *TestsDNSServerResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_dns_server. +func (r *TestsDNSServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsDNSServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().DnsServer().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_dns_server. +func (r *TestsDNSServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsDNSServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().DnsServer().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/model.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/model.go new file mode 100644 index 00000000..944d748e --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/model.go @@ -0,0 +1,66 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsDNSServerResourceModel is the Terraform state for a thousandeyes_tests_dns_server. +// +// Field order follows the schema, and the timeouts value is last. +type TestsDNSServerResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DNSQueryClass types.String `tfsdk:"dns_query_class"` + DNSServers types.Set `tfsdk:"dns_servers"` + DNSTransportProtocol types.String `tfsdk:"dns_transport_protocol"` + Domain types.String `tfsdk:"domain"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + Interval types.Int64 `tfsdk:"interval"` + Ipv6Policy types.String `tfsdk:"ipv6_policy"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + RecursiveQueries types.Bool `tfsdk:"recursive_queries"` + SavedEvent types.Bool `tfsdk:"saved_event"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// DnsServerAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type DnsServerAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// dnsServerAgentAttrTypes describes DnsServerAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var dnsServerAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var dnsServerAgentObjectType = types.ObjectType{AttrTypes: dnsServerAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource.go new file mode 100644 index 00000000..f82def63 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource.go @@ -0,0 +1,339 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_dns_server" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsDNSServerResource)(nil) + _ resource.ResourceWithConfigure = (*TestsDNSServerResource)(nil) + _ resource.ResourceWithImportState = (*TestsDNSServerResource)(nil) +) + +// NewTestsDNSServerResource returns the thousandeyes_tests_dns_server resource. +func NewTestsDNSServerResource() resource.Resource { + return &TestsDNSServerResource{} +} + +// TestsDNSServerResource implements the thousandeyes_tests_dns_server resource. +type TestsDNSServerResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsDNSServerResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsDNSServerResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsDNSServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsDNSServerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get DNS Server test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Observed: the API assigns false when " + + "this is omitted. SDK limitation: the wire field is a value-typed bool " + + "with omitempty, so an explicit `false` cannot be sent; with `network_measurements = true` " + + "the API then treats bandwidth measurement as requested, which cloud agents refuse. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "dns_query_class": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("in", "ch"), + }, + }, + "dns_servers": schema.SetAttribute{ + ElementType: types.StringType, + Required: true, + MarkdownDescription: "A list of DNS server FQDN. Sent as a list of server names; the read reports servers as " + + "objects, which v1 does not round-trip. The test's target: the API refuses a create without " + + "it, whatever the specification marks. The API " + + "enforces this field's presence, which the specification does not declare. ", + }, + "dns_transport_protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Transport protocol used for DNS requests. Computed as well as optional: the 2026-08-03 " + + "dispatched acceptance run (#12) observed the API applying its own value when this is " + + "omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("udp", "tcp"), + }, + }, + "domain": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The target record for the test, with the record type suffixed. If no record type is " + + "specified, the test defaults to an ANY record. The test's target: the API refuses a create " + + "without it, whatever the specification marks. The " + + "API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, example.com becomes " + + "\"example.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured " + + "form.", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "ipv6_policy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("force-ipv4", "prefer-ipv6", "force-ipv6", "use-agent-policy"), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + " Computed only on this endpoint: the SDK's value-typed omitempty bool " + + "cannot send false, and an update carrying true without an explicit bandwidthMeasurements " + + "false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no " + + "configurable value is expressible in both directions.", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Observed: the API assigns 1 when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "recursive_queries": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set true to run query with RD (recursion desired) flag enabled. Observed: the API assigns false when this is omitted. " + + "", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource_acceptance_test.go new file mode 100644 index 00000000..24eca502 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/resource_acceptance_test.go @@ -0,0 +1,127 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_dns_server.test" + +var testResource = tests_dns_server.TestsDNSServerTestResource{} + +// TestAccResourceTestsDNSServer_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsDNSServer_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_dns_server", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").HasValue("false"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("1"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("recursive_queries").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // dns_servers: it is write-only, carried from configuration, which an import does not have + // domain: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"dns_servers", "domain", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("dns_query_class").HasValue("in"), + check.That(address).Key("dns_transport_protocol").HasValue("udp"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("fixed_packet_rate").Exists(), + check.That(address).Key("interval").Exists(), + check.That(address).Key("ipv6_policy").HasValue("force-ipv4"), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("1"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("recursive_queries").HasValue("false"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/state.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/state.go new file mode 100644 index 00000000..0892c8bb --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/state.go @@ -0,0 +1,58 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsDNSServerResourceModel, remote models.Tests_API_DnsServerTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DNSQueryClass = convert.PtrStringerToFramework(remote.GetDnsQueryClass()) + data.DNSTransportProtocol = convert.PtrStringerToFramework(remote.GetDnsTransportProtocol()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FixedPacketRate = convert.PtrInt32ToFrameworkInt64(remote.GetFixedPacketRate()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.Ipv6Policy = convert.PtrStringerToFramework(remote.GetIpv6Policy()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.RecursiveQueries = convert.PtrBoolToFramework(remote.GetRecursiveQueries()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/test_helper_test.go new file mode 100644 index 00000000..74be2ef7 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsDNSServerTestResource answers whether a thousandeyes_tests_dns_server is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsDNSServerTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsDNSServerTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().DnsServer().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/maximal.tf new file mode 100644 index 00000000..70c22bf9 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/maximal.tf @@ -0,0 +1,78 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_dns_server" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # dns_query_class: documented; unprobed + # + # dns_servers: curated in the blueprint's accFixture; the generator cannot derive it + # + # dns_transport_protocol: documented; unprobed + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # enabled: the API's own default, so a value it is known to accept + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # ipv6_policy: documented; unprobed + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # recursive_queries: the API's own default, so a value it is known to accept + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + bandwidth_measurements = false + bgp_measurements = true + description = "tfacc-description" + dns_query_class = "in" + dns_servers = ["8.8.8.8"] + dns_transport_protocol = "udp" + domain = "example.com" + enabled = true + fixed_packet_rate = 50 + interval = 3600 + ipv6_policy = "force-ipv4" + mtu_measurements = true + num_path_traces = 1 + path_trace_mode = "classic" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + recursive_queries = false + test_name = "tfacc-test-name" + use_public_bgp = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/minimal.tf new file mode 100644 index 00000000..a7d76f58 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_server_tests/v7/tests_dns_server/testdata/minimal.tf @@ -0,0 +1,27 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_dns_server" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # dns_servers: curated in the blueprint's accFixture; the generator cannot derive it + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + dns_servers = ["8.8.8.8"] + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/construct.go new file mode 100644 index 00000000..3d95f5fe --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/construct.go @@ -0,0 +1,75 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsDNSTraceResourceModel) (*models.Tests_API_DnsTraceTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_DnsTraceTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + dNSQueryClassRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_DnsQueryClass](data.DNSQueryClass, models.ParseTests_API_DnsQueryClass) + diags.Append(d...) + body.SetDnsQueryClass(dNSQueryClassRaw) + dNSTransportProtocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDnsTransportProtocol](data.DNSTransportProtocol, models.ParseTests_API_TestDnsTransportProtocol) + diags.Append(d...) + body.SetDnsTransportProtocol(dNSTransportProtocolRaw) + body.SetDomain(convert.FrameworkToPtrString(data.Domain)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + agentsRaw, d := expandDnsTraceAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandDnsTraceAgents converts the configured DnsTraceAgentModel values into SDK structs. +func expandDnsTraceAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []DnsTraceAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/crud.go new file mode 100644 index 00000000..4a560c62 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_dns_trace. +func (r *TestsDNSTraceResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsDNSTraceResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().DnsTrace().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_dns_trace state from the API. +func (r *TestsDNSTraceResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsDNSTraceResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_dns_trace and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsDNSTraceResource) readState( + ctx context.Context, + state *TestsDNSTraceResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().DnsTrace().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsDNSTraceResource) readAfterWrite( + ctx context.Context, + state *TestsDNSTraceResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_dns_trace. +func (r *TestsDNSTraceResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsDNSTraceResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().DnsTrace().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_dns_trace. +func (r *TestsDNSTraceResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsDNSTraceResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().DnsTrace().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/model.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/model.go new file mode 100644 index 00000000..95f7b0f7 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/model.go @@ -0,0 +1,53 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsDNSTraceResourceModel is the Terraform state for a thousandeyes_tests_dns_trace. +// +// Field order follows the schema, and the timeouts value is last. +type TestsDNSTraceResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DNSQueryClass types.String `tfsdk:"dns_query_class"` + DNSTransportProtocol types.String `tfsdk:"dns_transport_protocol"` + Domain types.String `tfsdk:"domain"` + Enabled types.Bool `tfsdk:"enabled"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// DnsTraceAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type DnsTraceAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// dnsTraceAgentAttrTypes describes DnsTraceAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var dnsTraceAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var dnsTraceAgentObjectType = types.ObjectType{AttrTypes: dnsTraceAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource.go new file mode 100644 index 00000000..bb926aae --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource.go @@ -0,0 +1,203 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_dns_trace" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsDNSTraceResource)(nil) + _ resource.ResourceWithConfigure = (*TestsDNSTraceResource)(nil) + _ resource.ResourceWithImportState = (*TestsDNSTraceResource)(nil) +) + +// NewTestsDNSTraceResource returns the thousandeyes_tests_dns_trace resource. +func NewTestsDNSTraceResource() resource.Resource { + return &TestsDNSTraceResource{} +} + +// TestsDNSTraceResource implements the thousandeyes_tests_dns_trace resource. +type TestsDNSTraceResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsDNSTraceResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsDNSTraceResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsDNSTraceResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsDNSTraceResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get DNS Trace test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "dns_query_class": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("in", "ch"), + }, + }, + "dns_transport_protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Transport protocol used for DNS requests. Computed as well as optional: the 2026-08-03 " + + "dispatched acceptance run (#12) observed the API applying its own value when this is " + + "omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("udp", "tcp"), + }, + }, + "domain": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The target record for the test, with the record type suffixed. If no record type is " + + "specified, the test defaults to an ANY record. The test's target: the API refuses a create " + + "without it, whatever the specification marks. The " + + "API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, example.com becomes " + + "\"example.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured " + + "form.", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource_acceptance_test.go new file mode 100644 index 00000000..d8020ee1 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/resource_acceptance_test.go @@ -0,0 +1,106 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_dns_trace.test" + +var testResource = tests_dns_trace.TestsDNSTraceTestResource{} + +// TestAccResourceTestsDNSTrace_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsDNSTrace_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_dns_trace", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("randomized_start_time").HasValue("false"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // domain: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"domain", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("dns_query_class").HasValue("in"), + check.That(address).Key("dns_transport_protocol").HasValue("udp"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/state.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/state.go new file mode 100644 index 00000000..e5cf5a0d --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/state.go @@ -0,0 +1,46 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsDNSTraceResourceModel, remote models.Tests_API_DnsTraceTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DNSQueryClass = convert.PtrStringerToFramework(remote.GetDnsQueryClass()) + data.DNSTransportProtocol = convert.PtrStringerToFramework(remote.GetDnsTransportProtocol()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/test_helper_test.go new file mode 100644 index 00000000..34a930b0 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dns_trace + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsDNSTraceTestResource answers whether a thousandeyes_tests_dns_trace is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsDNSTraceTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsDNSTraceTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().DnsTrace().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/maximal.tf new file mode 100644 index 00000000..936ad570 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/maximal.tf @@ -0,0 +1,41 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_dns_trace" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # dns_query_class: documented; unprobed + # + # dns_transport_protocol: documented; unprobed + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # enabled: the API's own default, so a value it is known to accept + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + description = "tfacc-description" + dns_query_class = "in" + dns_transport_protocol = "udp" + domain = "example.com" + enabled = true + interval = 3600 + randomized_start_time = false + test_name = "tfacc-test-name" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/minimal.tf new file mode 100644 index 00000000..11fc9912 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dns_trace_tests/v7/tests_dns_trace/testdata/minimal.tf @@ -0,0 +1,24 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_dns_trace" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + domain = "example.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/construct.go new file mode 100644 index 00000000..fe5a9f7b --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/construct.go @@ -0,0 +1,72 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsDNSSECResourceModel) (*models.Tests_API_DnsSecTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_DnsSecTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + dNSQueryClassRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_DnsQueryClass](data.DNSQueryClass, models.ParseTests_API_DnsQueryClass) + diags.Append(d...) + body.SetDnsQueryClass(dNSQueryClassRaw) + body.SetDomain(convert.FrameworkToPtrString(data.Domain)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + agentsRaw, d := expandDnssecAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandDnssecAgents converts the configured DnssecAgentModel values into SDK structs. +func expandDnssecAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []DnssecAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/crud.go new file mode 100644 index 00000000..e3a47a2f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_dnssec. +func (r *TestsDNSSECResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsDNSSECResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().Dnssec().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_dnssec state from the API. +func (r *TestsDNSSECResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsDNSSECResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_dnssec and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsDNSSECResource) readState( + ctx context.Context, + state *TestsDNSSECResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().Dnssec().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsDNSSECResource) readAfterWrite( + ctx context.Context, + state *TestsDNSSECResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_dnssec. +func (r *TestsDNSSECResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsDNSSECResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().Dnssec().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_dnssec. +func (r *TestsDNSSECResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsDNSSECResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().Dnssec().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/model.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/model.go new file mode 100644 index 00000000..62a7c896 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/model.go @@ -0,0 +1,52 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsDNSSECResourceModel is the Terraform state for a thousandeyes_tests_dnssec. +// +// Field order follows the schema, and the timeouts value is last. +type TestsDNSSECResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DNSQueryClass types.String `tfsdk:"dns_query_class"` + Domain types.String `tfsdk:"domain"` + Enabled types.Bool `tfsdk:"enabled"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// DnssecAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type DnssecAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// dnssecAgentAttrTypes describes DnssecAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var dnssecAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var dnssecAgentObjectType = types.ObjectType{AttrTypes: dnssecAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource.go new file mode 100644 index 00000000..2b0a0d86 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource.go @@ -0,0 +1,192 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_dnssec" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsDNSSECResource)(nil) + _ resource.ResourceWithConfigure = (*TestsDNSSECResource)(nil) + _ resource.ResourceWithImportState = (*TestsDNSSECResource)(nil) +) + +// NewTestsDNSSECResource returns the thousandeyes_tests_dnssec resource. +func NewTestsDNSSECResource() resource.Resource { + return &TestsDNSSECResource{} +} + +// TestsDNSSECResource implements the thousandeyes_tests_dnssec resource. +type TestsDNSSECResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsDNSSECResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsDNSSECResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsDNSSECResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsDNSSECResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get DNSSEC test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "dns_query_class": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Domain class used by this test. 'in' stands for Internet, while 'ch' stands for Chaos. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("in", "ch"), + }, + }, + "domain": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The target record for the test, with the record type suffixed. If no record type is " + + "specified, the test defaults to an ANY record. The test's target: the API refuses a create " + + "without it, whatever the specification marks. The " + + "API enforces this field's presence, which the specification does not declare. The API normalises this value (appends the record type, cloudflare.com becomes " + + "\"cloudflare.com ANY\"; the 2026-08-03 acceptance run (#13)); state carries the configured " + + "form.", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource_acceptance_test.go new file mode 100644 index 00000000..dc01dde8 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/resource_acceptance_test.go @@ -0,0 +1,105 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_dnssec.test" + +var testResource = tests_dnssec.TestsDNSSECTestResource{} + +// TestAccResourceTestsDNSSEC_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsDNSSEC_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_dnssec", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("randomized_start_time").HasValue("false"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // domain: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"domain", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("dns_query_class").HasValue("in"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/state.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/state.go new file mode 100644 index 00000000..f1eb0d5a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/state.go @@ -0,0 +1,45 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsDNSSECResourceModel, remote models.Tests_API_DnsSecTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DNSQueryClass = convert.PtrStringerToFramework(remote.GetDnsQueryClass()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/test_helper_test.go new file mode 100644 index 00000000..68769cbe --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_dnssec + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsDNSSECTestResource answers whether a thousandeyes_tests_dnssec is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsDNSSECTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsDNSSECTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().Dnssec().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/maximal.tf new file mode 100644 index 00000000..698410c9 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/maximal.tf @@ -0,0 +1,38 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_dnssec" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # dns_query_class: documented; unprobed + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # enabled: the API's own default, so a value it is known to accept + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + description = "tfacc-description" + dns_query_class = "in" + domain = "cloudflare.com" + enabled = true + interval = 3600 + randomized_start_time = false + test_name = "tfacc-test-name" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/minimal.tf new file mode 100644 index 00000000..de0d89fb --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/dnssec_tests/v7/tests_dnssec/testdata/minimal.tf @@ -0,0 +1,24 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_dnssec" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # domain: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + domain = "cloudflare.com" + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/construct.go index 2e45fa15..8dc95130 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/crud.go index cd68e0b5..25fa9ca5 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/model.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/model.go index efc1cb20..79192fec 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource.go index b60b29e2..30fa8848 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource_acceptance_test.go index 3237162b..a684a55a 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/state.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/state.go index cb34b680..d464b63d 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/test_helper_test.go index 29af908d..02ea9863 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package endpoint_label diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/maximal.tf index 98a07a22..a9dd5c55 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/minimal.tf index 866a5c70..a04a558e 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/endpoint_agent_labels/v7/endpoint_label/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/construct.go new file mode 100644 index 00000000..929c704d --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/construct.go @@ -0,0 +1,97 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsFTPServerResourceModel) (*models.Tests_API_FtpServerTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_FtpServerTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetDownloadLimit(convert.FrameworkInt64ToPtrInt32(data.DownloadLimit)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetFtpTargetTime(convert.FrameworkInt64ToPtrInt32(data.FTPTargetTime)) + body.SetFtpTimeLimit(convert.FrameworkInt64ToPtrInt32(data.FTPTimeLimit)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + ipv6PolicyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestIpv6Policy](data.Ipv6Policy, models.ParseTests_API_TestIpv6Policy) + diags.Append(d...) + body.SetIpv6Policy(ipv6PolicyRaw) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetPassword(convert.FrameworkToPtrString(data.Password)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + requestTypeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_FtpServerRequestType](data.RequestType, models.ParseTests_API_FtpServerRequestType) + diags.Append(d...) + body.SetRequestType(requestTypeRaw) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUrl(convert.FrameworkToPtrString(data.URL)) + body.SetUseActiveFtp(convert.FrameworkToPtrBool(data.UseActiveFTP)) + body.SetUseExplicitFtps(convert.FrameworkToPtrBool(data.UseExplicitFTPs)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + body.SetUsername(convert.FrameworkToPtrString(data.Username)) + agentsRaw, d := expandFtpServerAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandFtpServerAgents converts the configured FtpServerAgentModel values into SDK structs. +func expandFtpServerAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []FtpServerAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/crud.go new file mode 100644 index 00000000..19d77d3b --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_ftp_server. +func (r *TestsFTPServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsFTPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().FtpServer().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_ftp_server state from the API. +func (r *TestsFTPServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsFTPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_ftp_server and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsFTPServerResource) readState( + ctx context.Context, + state *TestsFTPServerResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().FtpServer().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsFTPServerResource) readAfterWrite( + ctx context.Context, + state *TestsFTPServerResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_ftp_server. +func (r *TestsFTPServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsFTPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().FtpServer().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_ftp_server. +func (r *TestsFTPServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsFTPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().FtpServer().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/model.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/model.go new file mode 100644 index 00000000..a67fcf6b --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/model.go @@ -0,0 +1,70 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsFTPServerResourceModel is the Terraform state for a thousandeyes_tests_ftp_server. +// +// Field order follows the schema, and the timeouts value is last. +type TestsFTPServerResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DownloadLimit types.Int64 `tfsdk:"download_limit"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + FTPTargetTime types.Int64 `tfsdk:"ftp_target_time"` + FTPTimeLimit types.Int64 `tfsdk:"ftp_time_limit"` + Interval types.Int64 `tfsdk:"interval"` + Ipv6Policy types.String `tfsdk:"ipv6_policy"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + Password types.String `tfsdk:"password"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + RequestType types.String `tfsdk:"request_type"` + SavedEvent types.Bool `tfsdk:"saved_event"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + URL types.String `tfsdk:"url"` + UseActiveFTP types.Bool `tfsdk:"use_active_ftp"` + UseExplicitFTPs types.Bool `tfsdk:"use_explicit_ftps"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Username types.String `tfsdk:"username"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// FtpServerAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type FtpServerAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// ftpServerAgentAttrTypes describes FtpServerAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var ftpServerAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var ftpServerAgentObjectType = types.ObjectType{AttrTypes: ftpServerAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource.go new file mode 100644 index 00000000..e0ff9b3b --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource.go @@ -0,0 +1,364 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_ftp_server" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsFTPServerResource)(nil) + _ resource.ResourceWithConfigure = (*TestsFTPServerResource)(nil) + _ resource.ResourceWithImportState = (*TestsFTPServerResource)(nil) +) + +// NewTestsFTPServerResource returns the thousandeyes_tests_ftp_server resource. +func NewTestsFTPServerResource() resource.Resource { + return &TestsFTPServerResource{} +} + +// TestsFTPServerResource implements the thousandeyes_tests_ftp_server resource. +type TestsFTPServerResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsFTPServerResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsFTPServerResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsFTPServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsFTPServerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get FTP Server test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Observed: the API assigns false when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test. Neither the update " + + "response nor a read returns this field: it is write-only in practice, and state carries " + + "the configured value. ", + }, + "download_limit": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Specify maximum number of bytes to download from the target object. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. " + + "Neither the update response nor a read returns this field: it is write-only in practice, " + + "and state carries the configured value. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "ftp_target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for operation completion; specified in milliseconds. Observed: the API assigns 1000 when this is omitted. ", + Validators: []validator.Int64{ + int64validator.Between(1000, 6000), + }, + }, + "ftp_time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set the time limit for the test in seconds. " + + "Observed: the API assigns 5 when this is omitted. ", + Validators: []validator.Int64{ + int64validator.Between(10, 60), + }, + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "ipv6_policy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("force-ipv4", "prefer-ipv6", "force-ipv6", "use-agent-policy"), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + " Computed only on this endpoint: the SDK's value-typed omitempty bool " + + "cannot send false, and an update carrying true without an explicit bandwidthMeasurements " + + "false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no " + + "configurable value is expressible in both directions.", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Observed: the API assigns 3 when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "password": schema.StringAttribute{ + Optional: true, + Sensitive: true, + MarkdownDescription: "Password for Basic/NTLM authentication. Neither the " + + "update response nor a read returns this field: it is write-only in practice, and state " + + "carries the configured value. Write-only: the API never returns it (the " + + "2026-08-03 acceptance run (#13)); state carries the configured value. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "request_type": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Set the type of activity for the test. Values " + + "accepted here: `download`, `list`. The API enforces this field's presence, which the " + + "specification does not declare. ", + Validators: []validator.String{ + stringvalidator.OneOf("download", "upload", "list"), + }, + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "url": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Target for the test. The test's target: the API refuses a create without it, whatever the " + + "specification marks. The API enforces this field's " + + "presence, which the specification does not declare. The API normalises " + + "this value (appends a trailing slash; the 2026-08-03 acceptance run (#13)); state carries " + + "the configured form.", + }, + "use_active_ftp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Explicitly set the flag to use active FTP. Observed: " + + "the API assigns false when this is omitted. ", + }, + "use_explicit_ftps": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Use explicit FTPS (ftp over SSL). By default, tests will autodetect when it is appropriate " + + "to use FTPS. Observed: the API assigns false when " + + "this is omitted. ", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "username": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Username for Basic/NTLM authentication. The API " + + "enforces this field's presence, which the specification does not declare. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource_acceptance_test.go new file mode 100644 index 00000000..146d6b04 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/resource_acceptance_test.go @@ -0,0 +1,136 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_ftp_server.test" + +var testResource = tests_ftp_server.TestsFTPServerTestResource{} + +// TestAccResourceTestsFTPServer_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsFTPServer_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_ftp_server", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").HasValue("false"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("ftp_target_time").HasValue("1000"), + check.That(address).Key("ftp_time_limit").HasValue("5"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("request_type").HasValue("download"), + check.That(address).Key("use_active_ftp").HasValue("false"), + check.That(address).Key("use_explicit_ftps").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("username").Exists(), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // description: the API never returns it, so it is absent after an import + // download_limit: the API never returns it, so it is absent after an import + // fixed_packet_rate: the API never returns it, so it is absent after an import + // password: it is write-only, carried from configuration, which an import does not have + // url: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"description", "download_limit", "fixed_packet_rate", "password", "url", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("ftp_target_time").HasValue("1000"), + check.That(address).Key("ftp_time_limit").Exists(), + check.That(address).Key("interval").Exists(), + check.That(address).Key("ipv6_policy").HasValue("force-ipv4"), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("request_type").HasValue("download"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("use_active_ftp").HasValue("false"), + check.That(address).Key("use_explicit_ftps").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("username").Exists(), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/state.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/state.go new file mode 100644 index 00000000..e7ad0746 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/state.go @@ -0,0 +1,81 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsFTPServerResourceModel, remote models.Tests_API_FtpServerTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + // description is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.Description.IsUnknown() { + data.Description = types.StringNull() + } + // download_limit is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.DownloadLimit.IsUnknown() { + data.DownloadLimit = types.Int64Null() + } + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + // fixed_packet_rate is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.FixedPacketRate.IsUnknown() { + data.FixedPacketRate = types.Int64Null() + } + data.FTPTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetFtpTargetTime()) + data.FTPTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetFtpTimeLimit()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.Ipv6Policy = convert.PtrStringerToFramework(remote.GetIpv6Policy()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.RequestType = convert.PtrStringerToFramework(remote.GetRequestType()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UseActiveFTP = convert.PtrBoolToFramework(remote.GetUseActiveFtp()) + data.UseExplicitFTPs = convert.PtrBoolToFramework(remote.GetUseExplicitFtps()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + data.Username = convert.PtrStringToFramework(remote.GetUsername()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/test_helper_test.go new file mode 100644 index 00000000..5e97c9ff --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_ftp_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsFTPServerTestResource answers whether a thousandeyes_tests_ftp_server is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsFTPServerTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsFTPServerTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().FtpServer().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/maximal.tf new file mode 100644 index 00000000..3f03943a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/maximal.tf @@ -0,0 +1,88 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_ftp_server" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # enabled: the API's own default, so a value it is known to accept + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # ftp_target_time: the API's own default, so a value it is known to accept + # + # ftp_time_limit: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # ipv6_policy: documented; unprobed + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # password: curated in the blueprint's accFixture; the generator cannot derive it + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # request_type: observed accepted + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_active_ftp: the API's own default, so a value it is known to accept + # + # use_explicit_ftps: the API's own default, so a value it is known to accept + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # username: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + bandwidth_measurements = false + bgp_measurements = true + description = "tfacc-description" + download_limit = 1 + enabled = true + fixed_packet_rate = 50 + ftp_target_time = 1000 + ftp_time_limit = 30 + interval = 3600 + ipv6_policy = "force-ipv4" + mtu_measurements = true + num_path_traces = 3 + password = "guest" + path_trace_mode = "classic" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + request_type = "download" + test_name = "tfacc-test-name" + url = "ftp://speedtest.tele2.net" + use_active_ftp = false + use_explicit_ftps = false + use_public_bgp = true + username = "anonymous" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/minimal.tf new file mode 100644 index 00000000..9ec8868a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/ftp_server_tests/v7/tests_ftp_server/testdata/minimal.tf @@ -0,0 +1,33 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_ftp_server" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # password: curated in the blueprint's accFixture; the generator cannot derive it + # + # request_type: observed accepted + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # username: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + password = "guest" + request_type = "download" + url = "ftp://speedtest.tele2.net" + username = "anonymous" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/construct.go new file mode 100644 index 00000000..127d0a31 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/construct.go @@ -0,0 +1,153 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsHTTPServerResourceModel) (*models.Tests_API_HttpServerTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_HttpServerTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetAllowUnsafeLegacyRenegotiation(convert.FrameworkToPtrBool(data.AllowUnsafeLegacyRenegotiation)) + authTypeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestAuthType](data.AuthType, models.ParseTests_API_TestAuthType) + diags.Append(d...) + body.SetAuthType(authTypeRaw) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetClientCertificate(convert.FrameworkToPtrString(data.ClientCertificate)) + body.SetCollectProxyNetworkData(convert.FrameworkToPtrBool(data.CollectProxyNetworkData)) + body.SetContentRegex(convert.FrameworkToPtrString(data.ContentRegex)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetDesiredStatusCode(convert.FrameworkToPtrString(data.DesiredStatusCode)) + body.SetDistributedTracing(convert.FrameworkToPtrBool(data.DistributedTracing)) + body.SetDnsOverride(convert.FrameworkToPtrString(data.DNSOverride)) + body.SetDownloadLimit(convert.FrameworkInt64ToPtrInt32(data.DownloadLimit)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetFollowRedirects(convert.FrameworkToPtrBool(data.FollowRedirects)) + headersRaw, d := convert.FrameworkSetToStringSlice(ctx, data.Headers) + diags.Append(d...) + body.SetHeaders(headersRaw) + body.SetHttpTargetTime(convert.FrameworkInt64ToPtrInt32(data.HTTPTargetTime)) + body.SetHttpTimeLimit(convert.FrameworkInt64ToPtrInt32(data.HTTPTimeLimit)) + body.SetHttpVersion(convert.FrameworkInt64ToPtrInt32(data.HTTPVersion)) + body.SetIncludeHeaders(convert.FrameworkToPtrBool(data.IncludeHeaders)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + ipv6PolicyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestIpv6Policy](data.Ipv6Policy, models.ParseTests_API_TestIpv6Policy) + diags.Append(d...) + body.SetIpv6Policy(ipv6PolicyRaw) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetOverrideAgentProxy(convert.FrameworkToPtrBool(data.OverrideAgentProxy)) + body.SetOverrideProxyId(convert.FrameworkToPtrString(data.OverrideProxyID)) + body.SetPassword(convert.FrameworkToPtrString(data.Password)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + body.SetPostBody(convert.FrameworkToPtrString(data.PostBody)) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + requestMethodRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_RequestMethod](data.RequestMethod, models.ParseTests_API_RequestMethod) + diags.Append(d...) + body.SetRequestMethod(requestMethodRaw) + sSLVersionIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestSslVersionId](data.SSLVersionID, models.ParseTests_API_TestSslVersionId) + diags.Append(d...) + body.SetSslVersionId(sSLVersionIDRaw) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUrl(convert.FrameworkToPtrString(data.URL)) + body.SetUseNtlm(convert.FrameworkToPtrBool(data.UseNtlm)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + body.SetUserAgent(convert.FrameworkToPtrString(data.UserAgent)) + body.SetUsername(convert.FrameworkToPtrString(data.Username)) + vaultCredentialsRaw, d := expandTestsHTTPServerTestVaultCredentials(ctx, data.VaultCredentials) + diags.Append(d...) + body.SetVaultCredentials(vaultCredentialsRaw) + body.SetVerifyCertificate(convert.FrameworkToPtrBool(data.VerifyCertificate)) + agentsRaw, d := expandHttpServerAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandTestsHTTPServerTestVaultCredentials converts the configured TestsHTTPServerTestVaultCredentialModel values into SDK structs. +func expandTestsHTTPServerTestVaultCredentials(ctx context.Context, v types.Set) ([]models.Tests_API_TestVaultCredentialable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsHTTPServerTestVaultCredentialModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestVaultCredentialable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestVaultCredential() + + item.SetSecretId(convert.FrameworkToPtrString(m.SecretID)) + targetRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestVaultCredentialTarget](m.Target, models.ParseTests_API_TestVaultCredentialTarget) + diags.Append(d...) + item.SetTarget(targetRaw) + out = append(out, item) + } + + return out, diags +} + +// expandHttpServerAgents converts the configured HttpServerAgentModel values into SDK structs. +func expandHttpServerAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []HttpServerAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/crud.go new file mode 100644 index 00000000..d49b5252 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_http_server. +func (r *TestsHTTPServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsHTTPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().HttpServer().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_http_server state from the API. +func (r *TestsHTTPServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsHTTPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_http_server and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsHTTPServerResource) readState( + ctx context.Context, + state *TestsHTTPServerResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().HttpServer().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + diags.Append(mapRemoteStateToTerraform(ctx, state, remote)...) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsHTTPServerResource) readAfterWrite( + ctx context.Context, + state *TestsHTTPServerResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_http_server. +func (r *TestsHTTPServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsHTTPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().HttpServer().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_http_server. +func (r *TestsHTTPServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsHTTPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().HttpServer().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/model.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/model.go new file mode 100644 index 00000000..8aff3bff --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/model.go @@ -0,0 +1,109 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsHTTPServerResourceModel is the Terraform state for a thousandeyes_tests_http_server. +// +// Field order follows the schema, and the timeouts value is last. +type TestsHTTPServerResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + AllowUnsafeLegacyRenegotiation types.Bool `tfsdk:"allow_unsafe_legacy_renegotiation"` + AuthType types.String `tfsdk:"auth_type"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + ClientCertificate types.String `tfsdk:"client_certificate"` + CollectProxyNetworkData types.Bool `tfsdk:"collect_proxy_network_data"` + ContentRegex types.String `tfsdk:"content_regex"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DesiredStatusCode types.String `tfsdk:"desired_status_code"` + DistributedTracing types.Bool `tfsdk:"distributed_tracing"` + DNSOverride types.String `tfsdk:"dns_override"` + DownloadLimit types.Int64 `tfsdk:"download_limit"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + FollowRedirects types.Bool `tfsdk:"follow_redirects"` + Headers types.Set `tfsdk:"headers"` + HTTPTargetTime types.Int64 `tfsdk:"http_target_time"` + HTTPTimeLimit types.Int64 `tfsdk:"http_time_limit"` + HTTPVersion types.Int64 `tfsdk:"http_version"` + IncludeHeaders types.Bool `tfsdk:"include_headers"` + Interval types.Int64 `tfsdk:"interval"` + Ipv6Policy types.String `tfsdk:"ipv6_policy"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + OverrideAgentProxy types.Bool `tfsdk:"override_agent_proxy"` + OverrideProxyID types.String `tfsdk:"override_proxy_id"` + Password types.String `tfsdk:"password"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + PostBody types.String `tfsdk:"post_body"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + RequestMethod types.String `tfsdk:"request_method"` + SavedEvent types.Bool `tfsdk:"saved_event"` + SSLVersion types.String `tfsdk:"ssl_version"` + SSLVersionID types.String `tfsdk:"ssl_version_id"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + URL types.String `tfsdk:"url"` + UseNtlm types.Bool `tfsdk:"use_ntlm"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + UserAgent types.String `tfsdk:"user_agent"` + Username types.String `tfsdk:"username"` + VaultCredentials types.Set `tfsdk:"vault_credentials"` + VerifyCertificate types.Bool `tfsdk:"verify_certificate"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// TestsHTTPServerTestVaultCredentialModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsHTTPServerTestVaultCredentialModel struct { + SecretID types.String `tfsdk:"secret_id"` + Target types.String `tfsdk:"target"` +} + +// testsHTTPServerTestVaultCredentialAttrTypes describes TestsHTTPServerTestVaultCredentialModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsHTTPServerTestVaultCredentialAttrTypes = map[string]attr.Type{ + "secret_id": types.StringType, + "target": types.StringType, +} + +var testsHTTPServerTestVaultCredentialObjectType = types.ObjectType{AttrTypes: testsHTTPServerTestVaultCredentialAttrTypes} + +// HttpServerAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type HttpServerAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// httpServerAgentAttrTypes describes HttpServerAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var httpServerAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var httpServerAgentObjectType = types.ObjectType{AttrTypes: httpServerAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource.go new file mode 100644 index 00000000..78d27d45 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource.go @@ -0,0 +1,541 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_http_server" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsHTTPServerResource)(nil) + _ resource.ResourceWithConfigure = (*TestsHTTPServerResource)(nil) + _ resource.ResourceWithImportState = (*TestsHTTPServerResource)(nil) +) + +// NewTestsHTTPServerResource returns the thousandeyes_tests_http_server resource. +func NewTestsHTTPServerResource() resource.Resource { + return &TestsHTTPServerResource{} +} + +// TestsHTTPServerResource implements the thousandeyes_tests_http_server resource. +type TestsHTTPServerResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsHTTPServerResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsHTTPServerResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsHTTPServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsHTTPServerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get HTTP Server test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "allow_unsafe_legacy_renegotiation": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to " + + "allow unsafe legacy renegotiation. Observed: the API " + + "assigns true when this is omitted. The SDK's " + + "encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently " + + "becomes an omission. ", + }, + "auth_type": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("none", "basic", "ntlm", "kerberos", "oauth"), + }, + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Observed: the API assigns false when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "client_certificate": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "String representation (containing newline characters) of client certificate, the private " + + "key must be placed first, then the certificate. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "collect_proxy_network_data": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether network data to the proxy should be collected. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "content_regex": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Content regex, this field does not require escaping. " + + "Observed: the API assigns \"\" when this is omitted. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test. Neither the update " + + "response nor a read returns this field: it is write-only in practice, and state carries " + + "the configured value. ", + }, + "desired_status_code": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Specify the HTTP status code value that indicates a successful response. The default value " + + "accepts any 2xx or 3xx status code. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + " Neither the update response nor a " + + "read returns this field: it is write-only in practice, and state carries the configured " + + "value. ", + }, + "distributed_tracing": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "dns_override": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "IP address to use for DNS override. Neither the " + + "update response nor a read returns this field: it is write-only in practice, and state " + + "carries the configured value. ", + }, + "download_limit": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Specifies maximum number of bytes to download from the target object. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. " + + "Neither the update response nor a read returns this field: it is write-only in practice, " + + "and state carries the configured value. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "follow_redirects": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to " + + "`false`. Observed: the API assigns true when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "headers": schema.SetAttribute{ + ElementType: types.StringType, + Optional: true, + MarkdownDescription: "HTTP request headers used. Neither the update " + + "response nor a read returns this field: it is write-only in practice, and state carries " + + "the configured value. ", + }, + "http_target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for HTTP server completion, specified in milliseconds. Observed: the API assigns 1000 when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(100, 5000), + }, + }, + "http_time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP time limit in seconds. Observed: the API " + + "assigns 5 when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(5, 60), + }, + }, + "http_version": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Observed: the API assigns 2 when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 2), + }, + }, + "include_headers": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to capture response headers for objects loaded by the test. Computed as well " + + "as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its " + + "own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + " Neither the update response nor a " + + "read returns this field: it is write-only in practice, and state carries the configured " + + "value. ", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "ipv6_policy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "IP version policy. Overrides the IPv6 policy configured at the agent level. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("force-ipv4", "prefer-ipv6", "force-ipv6", "use-agent-policy"), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + " Computed only on this endpoint: the SDK's value-typed omitempty bool " + + "cannot send false, and an update carrying true without an explicit bandwidthMeasurements " + + "false is refused for cloud agents (live rehearsal + acceptance, 2026-08-03) -- no " + + "configurable value is expressible in both directions.", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Observed: the API assigns 3 when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "override_agent_proxy": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Flag indicating if a proxy other than the default should be used. To override the default " + + "proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "override_proxy_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "ID of the proxy to be used if the default proxy is overridden. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "password": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Password for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "post_body": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Enter the body for the HTTP POST request in this field. No special escaping is required. " + + "If content is provided and `requestMethod` is not specified, `requestMethod` is " + + "automatically set to `post`. Neither the update " + + "response nor a read returns this field: it is write-only in practice, and state carries " + + "the configured value. ", + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "request_method": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP request method. Computed as well as optional: the 2026-08-03 dispatched acceptance " + + "run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("get", "post"), + }, + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "ssl_version": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Reflects the verbose SSL protocol version used by a test.", + }, + "ssl_version_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for " + + "TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed " + + "as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API " + + "applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "3", "4", "5", "6", "7"), + }, + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "url": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Target for the test. The test's target: the API refuses a create without it, whatever the " + + "specification marks. The API enforces this field's " + + "presence, which the specification does not declare. ", + }, + "use_ntlm": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to true to use NTLM, false to use Basic Authentication. Requires username and password " + + "to be set. Observed: the API assigns false when this " + + "is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "user_agent": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "User-agent string to be provided during the test. The SDK's " + + "encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently " + + "becomes an omission. Neither the " + + "update response nor a read returns this field: it is write-only in practice, and state " + + "carries the configured value. ", + }, + "username": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Username for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "vault_credentials": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "secret_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "UUID of the configured secret.", + }, + "target": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The target setting that the credential should be used for.", + Validators: []validator.String{ + stringvalidator.OneOf("username", "password", "script"), + }, + }, + }, + }, + Optional: true, + Computed: true, + MarkdownDescription: "List of credential IDs that are stored in an external vault. Computed as well as optional: " + + "the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value " + + "when this is omitted.", + }, + "verify_certificate": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. Neither the update response nor a read returns this " + + "field: it is write-only in practice, and state carries the configured value. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource_acceptance_test.go new file mode 100644 index 00000000..df14c394 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/resource_acceptance_test.go @@ -0,0 +1,154 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_http_server.test" + +var testResource = tests_http_server.TestsHTTPServerTestResource{} + +// TestAccResourceTestsHTTPServer_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsHTTPServer_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_http_server", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("allow_unsafe_legacy_renegotiation").HasValue("true"), + check.That(address).Key("bandwidth_measurements").HasValue("false"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("collect_proxy_network_data").HasValue("false"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("follow_redirects").HasValue("true"), + check.That(address).Key("http_target_time").HasValue("1000"), + check.That(address).Key("http_time_limit").HasValue("5"), + check.That(address).Key("http_version").HasValue("2"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_ntlm").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("verify_certificate").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // description: the API never returns it, so it is absent after an import + // desired_status_code: the API never returns it, so it is absent after an import + // dns_override: the API never returns it, so it is absent after an import + // download_limit: the API never returns it, so it is absent after an import + // fixed_packet_rate: the API never returns it, so it is absent after an import + // headers: the API never returns it, so it is absent after an import + // include_headers: the API never returns it, so it is absent after an import + // post_body: the API never returns it, so it is absent after an import + // user_agent: the API never returns it, so it is absent after an import + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"description", "desired_status_code", "dns_override", "download_limit", "fixed_packet_rate", "headers", "include_headers", "post_body", "user_agent", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("allow_unsafe_legacy_renegotiation").HasValue("true"), + check.That(address).Key("auth_type").HasValue("none"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("collect_proxy_network_data").HasValue("false"), + check.That(address).Key("content_regex").HasValue("tfacc-content-regex"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("follow_redirects").HasValue("true"), + check.That(address).Key("http_target_time").HasValue("1000"), + check.That(address).Key("http_time_limit").HasValue("5"), + check.That(address).Key("http_version").HasValue("2"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("ipv6_policy").HasValue("force-ipv4"), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("request_method").HasValue("get"), + check.That(address).Key("ssl_version_id").HasValue("0"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_ntlm").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("verify_certificate").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/state.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/state.go new file mode 100644 index 00000000..d9b51008 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/state.go @@ -0,0 +1,172 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsHTTPServerResourceModel, remote models.Tests_API_HttpServerTestResponseable) diag.Diagnostics { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return diags + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.AllowUnsafeLegacyRenegotiation = convert.PtrBoolToFramework(remote.GetAllowUnsafeLegacyRenegotiation()) + data.AuthType = convert.PtrStringerToFramework(remote.GetAuthType()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.ClientCertificate = convert.PtrStringToFramework(remote.GetClientCertificate()) + data.CollectProxyNetworkData = convert.PtrBoolToFramework(remote.GetCollectProxyNetworkData()) + data.ContentRegex = convert.PtrStringToFramework(remote.GetContentRegex()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + // description is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.Description.IsUnknown() { + data.Description = types.StringNull() + } + // desired_status_code is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.DesiredStatusCode.IsUnknown() { + data.DesiredStatusCode = types.StringNull() + } + data.DistributedTracing = convert.PtrBoolToFramework(remote.GetDistributedTracing()) + // dns_override is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.DNSOverride.IsUnknown() { + data.DNSOverride = types.StringNull() + } + // download_limit is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.DownloadLimit.IsUnknown() { + data.DownloadLimit = types.Int64Null() + } + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + // fixed_packet_rate is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.FixedPacketRate.IsUnknown() { + data.FixedPacketRate = types.Int64Null() + } + data.FollowRedirects = convert.PtrBoolToFramework(remote.GetFollowRedirects()) + // headers is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.Headers.IsUnknown() { + data.Headers = types.SetNull(types.StringType) + } + data.HTTPTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTargetTime()) + data.HTTPTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTimeLimit()) + data.HTTPVersion = convert.PtrInt32ToFrameworkInt64(remote.GetHttpVersion()) + // include_headers is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.IncludeHeaders.IsUnknown() { + data.IncludeHeaders = types.BoolNull() + } + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.Ipv6Policy = convert.PtrStringerToFramework(remote.GetIpv6Policy()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.OverrideAgentProxy = convert.PtrBoolToFramework(remote.GetOverrideAgentProxy()) + data.OverrideProxyID = convert.PtrStringToFramework(remote.GetOverrideProxyId()) + data.Password = convert.PtrStringToFramework(remote.GetPassword()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + // post_body is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.PostBody.IsUnknown() { + data.PostBody = types.StringNull() + } + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.RequestMethod = convert.PtrStringerToFramework(remote.GetRequestMethod()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.SSLVersion = convert.PtrStringToFramework(remote.GetSslVersion()) + data.SSLVersionID = convert.PtrStringerToFramework(remote.GetSslVersionId()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.URL = convert.PtrStringToFramework(remote.GetUrl()) + data.UseNtlm = convert.PtrBoolToFramework(remote.GetUseNtlm()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + // user_agent is deliberately not read back: the API accepts it and never returns + // it, so flattening would blank the configured value on every read. An + // unset value still has to resolve, or the apply is rejected for leaving + // it unknown. + if data.UserAgent.IsUnknown() { + data.UserAgent = types.StringNull() + } + data.Username = convert.PtrStringToFramework(remote.GetUsername()) + data.VaultCredentials, d = flattenTestsHTTPServerTestVaultCredentials(ctx, remote.GetVaultCredentials()) + diags.Append(d...) + data.VerifyCertificate = convert.PtrBoolToFramework(remote.GetVerifyCertificate()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) + + return diags +} + +// flattenTestsHTTPServerTestVaultCredentials converts SDK structs into the framework value state holds. +func flattenTestsHTTPServerTestVaultCredentials(ctx context.Context, in []models.Tests_API_TestVaultCredentialable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsHTTPServerTestVaultCredentialObjectType), diags + } + + elements := make([]TestsHTTPServerTestVaultCredentialModel, 0, len(in)) + for _, item := range in { + var m TestsHTTPServerTestVaultCredentialModel + + m.SecretID = convert.PtrStringToFramework(item.GetSecretId()) + m.Target = convert.PtrStringerToFramework(item.GetTarget()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsHTTPServerTestVaultCredentialObjectType, elements) + diags.Append(d2...) + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/test_helper_test.go new file mode 100644 index 00000000..12302a5e --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_http_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsHTTPServerTestResource answers whether a thousandeyes_tests_http_server is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsHTTPServerTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsHTTPServerTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().HttpServer().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/maximal.tf new file mode 100644 index 00000000..f1dff029 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/maximal.tf @@ -0,0 +1,137 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_http_server" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # allow_unsafe_legacy_renegotiation: the API's own default, so a value it is known to accept + # + # auth_type: documented; unprobed + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # collect_proxy_network_data: the API's own default, so a value it is known to accept + # + # desired_status_code: curated in the blueprint's accFixture; the generator cannot derive it + # + # distributed_tracing: the API's own default, so a value it is known to accept + # + # dns_override: curated in the blueprint's accFixture; the generator cannot derive it + # + # enabled: the API's own default, so a value it is known to accept + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # follow_redirects: the API's own default, so a value it is known to accept + # + # headers: curated in the blueprint's accFixture; the generator cannot derive it + # + # http_target_time: the API's own default, so a value it is known to accept + # + # http_time_limit: the API's own default, so a value it is known to accept + # + # http_version: the API's own default, so a value it is known to accept + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # ipv6_policy: documented; unprobed + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # override_agent_proxy: the API's own default, so a value it is known to accept + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # request_method: documented; unprobed + # + # ssl_version_id: documented; unprobed + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_ntlm: the API's own default, so a value it is known to accept + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # verify_certificate: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + # + # Not filled in, because no correct value could be derived. Each of these is optional, so this + # configuration is valid as it stands -- but it is testing less than it could. + # + # client_certificate: it is credential-shaped, and a generated fixture must not invent values + # that read as secrets; supply one through accFixture if the test needs it + # + # override_proxy_id: it references an object that must already exist, which a synthesised + # value cannot name; supply one through accFixture if the test has the object + # + # password: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # username: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # vault_credentials: a nested object's members may be identifiers of objects that must already + # exist, and nothing in the specification says whether they are + alerts_enabled = true + allow_unsafe_legacy_renegotiation = true + auth_type = "none" + bandwidth_measurements = false + bgp_measurements = true + collect_proxy_network_data = false + content_regex = "tfacc-content-regex" + description = "tfacc-description" + desired_status_code = "200" + distributed_tracing = false + dns_override = "8.8.8.8" + download_limit = 1 + enabled = true + fixed_packet_rate = 50 + follow_redirects = true + headers = ["X-Tfacc: yes"] + http_target_time = 1000 + http_time_limit = 5 + http_version = 2 + include_headers = true + interval = 3600 + ipv6_policy = "force-ipv4" + mtu_measurements = true + num_path_traces = 3 + override_agent_proxy = false + path_trace_mode = "classic" + post_body = "tfacc-post-body" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + request_method = "get" + ssl_version_id = "0" + test_name = "tfacc-test-name" + url = "https://www.example.com" + use_ntlm = false + use_public_bgp = true + user_agent = "tfacc-user-agent" + verify_certificate = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/minimal.tf new file mode 100644 index 00000000..fcd4e69b --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/http_server_tests/v7/tests_http_server/testdata/minimal.tf @@ -0,0 +1,24 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_http_server" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/construct.go new file mode 100644 index 00000000..7bf815ee --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/construct.go @@ -0,0 +1,158 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsPageLoadResourceModel) (*models.Tests_API_PageLoadTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_PageLoadTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetAllowGeolocation(convert.FrameworkToPtrBool(data.AllowGeolocation)) + body.SetAllowMicAndCamera(convert.FrameworkToPtrBool(data.AllowMicAndCamera)) + body.SetAllowUnsafeLegacyRenegotiation(convert.FrameworkToPtrBool(data.AllowUnsafeLegacyRenegotiation)) + authTypeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestAuthType](data.AuthType, models.ParseTests_API_TestAuthType) + diags.Append(d...) + body.SetAuthType(authTypeRaw) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetBlockDomains(convert.FrameworkToPtrString(data.BlockDomains)) + body.SetBrowserLanguage(convert.FrameworkToPtrString(data.BrowserLanguage)) + body.SetChromeOptions(convert.FrameworkToPtrString(data.ChromeOptions)) + body.SetClientCertificate(convert.FrameworkToPtrString(data.ClientCertificate)) + body.SetCollectProxyNetworkData(convert.FrameworkToPtrBool(data.CollectProxyNetworkData)) + body.SetContentRegex(convert.FrameworkToPtrString(data.ContentRegex)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetDesiredStatusCode(convert.FrameworkToPtrString(data.DesiredStatusCode)) + body.SetDisableScreenshot(convert.FrameworkToPtrBool(data.DisableScreenshot)) + body.SetDistributedTracing(convert.FrameworkToPtrBool(data.DistributedTracing)) + body.SetDnsOverride(convert.FrameworkToPtrString(data.DNSOverride)) + body.SetDownloadLimit(convert.FrameworkInt64ToPtrInt32(data.DownloadLimit)) + body.SetEmulatedDeviceId(convert.FrameworkToPtrString(data.EmulatedDeviceID)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetFollowRedirects(convert.FrameworkToPtrBool(data.FollowRedirects)) + body.SetHttpInterval(convert.FrameworkInt64ToPtrInt32(data.HTTPInterval)) + body.SetHttpTargetTime(convert.FrameworkInt64ToPtrInt32(data.HTTPTargetTime)) + body.SetHttpTimeLimit(convert.FrameworkInt64ToPtrInt32(data.HTTPTimeLimit)) + body.SetHttpVersion(convert.FrameworkInt64ToPtrInt32(data.HTTPVersion)) + body.SetIdentifyAgentTrafficWithUserAgent(convert.FrameworkToPtrBool(data.IdentifyAgentTrafficWithUserAgent)) + body.SetIncludeHeaders(convert.FrameworkToPtrBool(data.IncludeHeaders)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetOverrideAgentProxy(convert.FrameworkToPtrBool(data.OverrideAgentProxy)) + body.SetOverrideProxyId(convert.FrameworkToPtrString(data.OverrideProxyID)) + body.SetPageLoadTargetTime(convert.FrameworkInt64ToPtrInt32(data.PageLoadTargetTime)) + body.SetPageLoadTimeLimit(convert.FrameworkInt64ToPtrInt32(data.PageLoadTimeLimit)) + pageLoadingStrategyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPageLoadingStrategy](data.PageLoadingStrategy, models.ParseTests_API_TestPageLoadingStrategy) + diags.Append(d...) + body.SetPageLoadingStrategy(pageLoadingStrategyRaw) + body.SetPassword(convert.FrameworkToPtrString(data.Password)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + sSLVersionIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestSslVersionId](data.SSLVersionID, models.ParseTests_API_TestSslVersionId) + diags.Append(d...) + body.SetSslVersionId(sSLVersionIDRaw) + body.SetSubinterval(convert.FrameworkInt64ToPtrInt32(data.Subinterval)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUrl(convert.FrameworkToPtrString(data.URL)) + body.SetUseNtlm(convert.FrameworkToPtrBool(data.UseNtlm)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + body.SetUserAgent(convert.FrameworkToPtrString(data.UserAgent)) + body.SetUsername(convert.FrameworkToPtrString(data.Username)) + vaultCredentialsRaw, d := expandTestsPageLoadTestVaultCredentials(ctx, data.VaultCredentials) + diags.Append(d...) + body.SetVaultCredentials(vaultCredentialsRaw) + body.SetVerifyCertificate(convert.FrameworkToPtrBool(data.VerifyCertificate)) + agentsRaw, d := expandPageLoadAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandTestsPageLoadTestVaultCredentials converts the configured TestsPageLoadTestVaultCredentialModel values into SDK structs. +func expandTestsPageLoadTestVaultCredentials(ctx context.Context, v types.Set) ([]models.Tests_API_TestVaultCredentialable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsPageLoadTestVaultCredentialModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestVaultCredentialable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestVaultCredential() + + item.SetSecretId(convert.FrameworkToPtrString(m.SecretID)) + targetRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestVaultCredentialTarget](m.Target, models.ParseTests_API_TestVaultCredentialTarget) + diags.Append(d...) + item.SetTarget(targetRaw) + out = append(out, item) + } + + return out, diags +} + +// expandPageLoadAgents converts the configured PageLoadAgentModel values into SDK structs. +func expandPageLoadAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []PageLoadAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/crud.go new file mode 100644 index 00000000..7d3fddbb --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_page_load. +func (r *TestsPageLoadResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsPageLoadResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().PageLoad().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_page_load state from the API. +func (r *TestsPageLoadResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsPageLoadResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_page_load and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsPageLoadResource) readState( + ctx context.Context, + state *TestsPageLoadResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().PageLoad().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + diags.Append(mapRemoteStateToTerraform(ctx, state, remote)...) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsPageLoadResource) readAfterWrite( + ctx context.Context, + state *TestsPageLoadResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_page_load. +func (r *TestsPageLoadResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsPageLoadResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().PageLoad().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_page_load. +func (r *TestsPageLoadResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsPageLoadResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().PageLoad().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/model.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/model.go new file mode 100644 index 00000000..7783c661 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/model.go @@ -0,0 +1,118 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsPageLoadResourceModel is the Terraform state for a thousandeyes_tests_page_load. +// +// Field order follows the schema, and the timeouts value is last. +type TestsPageLoadResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + AllowGeolocation types.Bool `tfsdk:"allow_geolocation"` + AllowMicAndCamera types.Bool `tfsdk:"allow_mic_and_camera"` + AllowUnsafeLegacyRenegotiation types.Bool `tfsdk:"allow_unsafe_legacy_renegotiation"` + AuthType types.String `tfsdk:"auth_type"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + BlockDomains types.String `tfsdk:"block_domains"` + BrowserLanguage types.String `tfsdk:"browser_language"` + ChromeOptions types.String `tfsdk:"chrome_options"` + ClientCertificate types.String `tfsdk:"client_certificate"` + CollectProxyNetworkData types.Bool `tfsdk:"collect_proxy_network_data"` + ContentRegex types.String `tfsdk:"content_regex"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + DesiredStatusCode types.String `tfsdk:"desired_status_code"` + DisableScreenshot types.Bool `tfsdk:"disable_screenshot"` + DistributedTracing types.Bool `tfsdk:"distributed_tracing"` + DNSOverride types.String `tfsdk:"dns_override"` + DownloadLimit types.Int64 `tfsdk:"download_limit"` + EmulatedDeviceID types.String `tfsdk:"emulated_device_id"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + FollowRedirects types.Bool `tfsdk:"follow_redirects"` + HTTPInterval types.Int64 `tfsdk:"http_interval"` + HTTPTargetTime types.Int64 `tfsdk:"http_target_time"` + HTTPTimeLimit types.Int64 `tfsdk:"http_time_limit"` + HTTPVersion types.Int64 `tfsdk:"http_version"` + IdentifyAgentTrafficWithUserAgent types.Bool `tfsdk:"identify_agent_traffic_with_user_agent"` + IncludeHeaders types.Bool `tfsdk:"include_headers"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + OverrideAgentProxy types.Bool `tfsdk:"override_agent_proxy"` + OverrideProxyID types.String `tfsdk:"override_proxy_id"` + PageLoadTargetTime types.Int64 `tfsdk:"page_load_target_time"` + PageLoadTimeLimit types.Int64 `tfsdk:"page_load_time_limit"` + PageLoadingStrategy types.String `tfsdk:"page_loading_strategy"` + Password types.String `tfsdk:"password"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + SSLVersion types.String `tfsdk:"ssl_version"` + SSLVersionID types.String `tfsdk:"ssl_version_id"` + Subinterval types.Int64 `tfsdk:"subinterval"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + URL types.String `tfsdk:"url"` + UseNtlm types.Bool `tfsdk:"use_ntlm"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + UserAgent types.String `tfsdk:"user_agent"` + Username types.String `tfsdk:"username"` + VaultCredentials types.Set `tfsdk:"vault_credentials"` + VerifyCertificate types.Bool `tfsdk:"verify_certificate"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// TestsPageLoadTestVaultCredentialModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsPageLoadTestVaultCredentialModel struct { + SecretID types.String `tfsdk:"secret_id"` + Target types.String `tfsdk:"target"` +} + +// testsPageLoadTestVaultCredentialAttrTypes describes TestsPageLoadTestVaultCredentialModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsPageLoadTestVaultCredentialAttrTypes = map[string]attr.Type{ + "secret_id": types.StringType, + "target": types.StringType, +} + +var testsPageLoadTestVaultCredentialObjectType = types.ObjectType{AttrTypes: testsPageLoadTestVaultCredentialAttrTypes} + +// PageLoadAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type PageLoadAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// pageLoadAgentAttrTypes describes PageLoadAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var pageLoadAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var pageLoadAgentObjectType = types.ObjectType{AttrTypes: pageLoadAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource.go new file mode 100644 index 00000000..b56bb814 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource.go @@ -0,0 +1,611 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_page_load" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsPageLoadResource)(nil) + _ resource.ResourceWithConfigure = (*TestsPageLoadResource)(nil) + _ resource.ResourceWithImportState = (*TestsPageLoadResource)(nil) +) + +// NewTestsPageLoadResource returns the thousandeyes_tests_page_load resource. +func NewTestsPageLoadResource() resource.Resource { + return &TestsPageLoadResource{} +} + +// TestsPageLoadResource implements the thousandeyes_tests_page_load resource. +type TestsPageLoadResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsPageLoadResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsPageLoadResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsPageLoadResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsPageLoadResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get Page Load test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Observed: the API " + + "assigns true when this is omitted. ", + }, + "allow_geolocation": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set true to use the agent’s geolocation by the web page. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "allow_mic_and_camera": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set true allow the use of a fake mic and camera in the browser. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "allow_unsafe_legacy_renegotiation": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to " + + "allow unsafe legacy renegotiation. Observed: the API " + + "assigns true when this is omitted. The SDK's " + + "encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently " + + "becomes an omission. ", + }, + "auth_type": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("none", "basic", "ntlm", "kerberos", "oauth"), + }, + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Observed: the API assigns false when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Observed: " + + "the API assigns true when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "block_domains": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Domains or full object URLs to be excluded from metrics and waterfall data for transaction " + + "tests. Observed: the API assigns \"\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "browser_language": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set one of the available browser language that you want to use to configure the browser. " + + " Observed: the API assigns \"en-US\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "chrome_options": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Command-line options passed to Chrome when running the test. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "client_certificate": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "String representation (containing newline characters) of client certificate, the private " + + "key must be placed first, then the certificate. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "collect_proxy_network_data": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether network data to the proxy should be collected. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "content_regex": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Content regex, this field does not require escaping. " + + "Observed: the API assigns \"\" when this is omitted. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "desired_status_code": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Specify the HTTP status code value that indicates a successful response. The default value " + + "accepts any 2xx or 3xx status code. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "disable_screenshot": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Enables or disables screenshots on error. Set true to not capture Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "distributed_tracing": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Adds distributed tracing headers to API requests using B3 and W3C standards. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "dns_override": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "IP address to use for DNS override. Write-only on this endpoint: the read never reports it " + + "(local acceptance run, 2026-08-03); state carries the configured value.", + }, + "download_limit": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Specifies maximum number of bytes to download from the target object. This endpoint never " + + "reports the value back (local acceptance run, 2026-08-03); state carries the configured " + + "value.", + }, + "emulated_device_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "ID of the emulated device, if one was given when the test was created. Observed: the API assigns \"281474976710656\" when this is " + + "omitted. ", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Observed: the API assigns true when " + + "this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "follow_redirects": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to " + + "`false`. Observed: the API assigns true when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "http_interval": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP test run interval. The interval between HTTP test runs in seconds cannot exceed the " + + "specified interval value and defaults to the same value as the interval if not set. " + + "Documented values: `60`, `120`, `300`, `600`, `900`, `1800`, `3600`. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "http_target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for HTTP server completion, specified in milliseconds. Observed: the API assigns 1000 when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(100, 5000), + }, + }, + "http_time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP time limit in seconds. Observed: the API " + + "assigns 5 when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(5, 60), + }, + }, + "http_version": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Observed: the API assigns 2 when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 2), + }, + }, + "identify_agent_traffic_with_user_agent": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Determines how agent traffic is identified: * `false`: Adds the `x-thousandeyes-agent: " + + "yes` header. * `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header. For more " + + "information, see [Notes on Agent ID " + + "Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy). " + + " Observed: the API assigns false when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "include_headers": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to capture response headers for objects loaded by the test. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run). " + + " The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Observed: the API assigns true when " + + "this is omitted. Computed only on this endpoint: browser tests always " + + "network-measure, and the SDK's value-typed omitempty bool cannot express false anyway " + + "(local acceptance run, 2026-08-03).", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. " + + "Observed: the API assigns 3 when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "override_agent_proxy": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Flag indicating if a proxy other than the default should be used. To override the default " + + "proxy for agents, set to `true` and specify a value for `overrideProxyId`. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "override_proxy_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "ID of the proxy to be used if the default proxy is overridden. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "page_load_target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for page load completion, specified in seconds and cannot exceed the " + + "`pageLoadTimeLimit`. Observed: the API assigns 6 " + + "when this is omitted. ", + Validators: []validator.Int64{ + int64validator.Between(1, 60), + }, + }, + "page_load_time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Page load time limit. Must be larger than the `httpTimeLimit`. Observed: the API assigns 10 when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(5, 60), + }, + }, + "page_loading_strategy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "* `normal`: The test waits until the entire page is fully loaded, including the " + + "downloading and parsing of HTML content as well as all associated resources, before " + + "advancing to the next action in the transaction test script. * `eager`: The test waits for " + + "the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the " + + "document reaches the \"interactive\" readiness state, before proceeding to the next action " + + "in the test script. * `none`: The test only waits for the download of HTML content. Once " + + "the HTML is downloaded, the test continues to the next action in the transaction test " + + "script without waiting for additional resources. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("normal", "eager", "none"), + }, + }, + "password": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Password for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). Values accepted here: `tcp`, `icmp`. The specification " + + "documents `udp`, which the API rejected. Observed: the API assigns \"tcp\" when this is " + + "omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Observed: the API assigns false when this is omitted. " + + " The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "ssl_version": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Reflects the verbose SSL protocol version used by a test.", + }, + "ssl_version_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for " + + "TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed " + + "as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API " + + "applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "3", "4", "5", "6", "7"), + }, + }, + "subinterval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Subinterval for round-robin testing (in seconds). Must be less than or equal to interval " + + "and must evenly divide interval. Documented values: `60`, `120`, `300`, `600`, `900`, " + + "`1200`, `1800`, `3600`. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "url": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Target for the test. The test's target: the API refuses a create without it, whatever the " + + "specification marks. The API enforces this field's " + + "presence, which the specification does not declare. ", + }, + "use_ntlm": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to true to use NTLM, false to use Basic Authentication. Requires username and password " + + "to be set. Observed: the API assigns false when this " + + "is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Observed: the API assigns " + + "true when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "user_agent": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "User-agent string to be provided during the test. The SDK's " + + "encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently " + + "becomes an omission. ", + }, + "username": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Username for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "vault_credentials": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "secret_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "UUID of the configured secret.", + }, + "target": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The target setting that the credential should be used for. Values accepted here: `username`, `password`, `script`. " + + "The API accepted a value from outside the documented set, so no OneOf validator is " + + "generated for this attribute. ", + }, + }, + }, + Optional: true, + Computed: true, + MarkdownDescription: "List of credential IDs that are stored in an external vault. Computed as well as optional: " + + "the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value " + + "when this is omitted.", + }, + "verify_certificate": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. Observed: the API assigns true when this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state. The API enforces this field's presence, which the " + + "specification does not declare. ", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource_acceptance_test.go new file mode 100644 index 00000000..1889350d --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/resource_acceptance_test.go @@ -0,0 +1,171 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_page_load.test" + +var testResource = tests_page_load.TestsPageLoadTestResource{} + +// TestAccResourceTestsPageLoad_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsPageLoad_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_page_load", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("allow_geolocation").HasValue("false"), + check.That(address).Key("allow_mic_and_camera").HasValue("false"), + check.That(address).Key("allow_unsafe_legacy_renegotiation").HasValue("true"), + check.That(address).Key("bandwidth_measurements").HasValue("false"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("browser_language").HasValue("en-US"), + check.That(address).Key("disable_screenshot").HasValue("false"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("emulated_device_id").HasValue("281474976710656"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("follow_redirects").HasValue("true"), + check.That(address).Key("http_target_time").HasValue("1000"), + check.That(address).Key("http_time_limit").HasValue("5"), + check.That(address).Key("http_version").HasValue("2"), + check.That(address).Key("identify_agent_traffic_with_user_agent").HasValue("false"), + check.That(address).Key("include_headers").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("page_load_target_time").HasValue("6"), + check.That(address).Key("page_load_time_limit").HasValue("10"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_ntlm").HasValue("false"), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("verify_certificate").HasValue("true"), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // dns_override: it is write-only, carried from configuration, which an import does not have + // download_limit: it is write-only, carried from configuration, which an import does not have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"dns_override", "download_limit", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("allow_geolocation").HasValue("false"), + check.That(address).Key("allow_mic_and_camera").HasValue("false"), + check.That(address).Key("allow_unsafe_legacy_renegotiation").HasValue("true"), + check.That(address).Key("auth_type").HasValue("none"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("block_domains").HasValue("tfacc-block-domains"), + check.That(address).Key("browser_language").HasValue("en-US"), + check.That(address).Key("chrome_options").Exists(), + check.That(address).Key("collect_proxy_network_data").Exists(), + check.That(address).Key("content_regex").HasValue("tfacc-content-regex"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("desired_status_code").Exists(), + check.That(address).Key("disable_screenshot").HasValue("false"), + check.That(address).Key("distributed_tracing").HasValue("false"), + check.That(address).Key("emulated_device_id").HasValue("281474976710656"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("fixed_packet_rate").Exists(), + check.That(address).Key("follow_redirects").HasValue("true"), + check.That(address).Key("http_interval").Exists(), + check.That(address).Key("http_target_time").HasValue("1000"), + check.That(address).Key("http_time_limit").HasValue("5"), + check.That(address).Key("http_version").HasValue("2"), + check.That(address).Key("identify_agent_traffic_with_user_agent").HasValue("false"), + check.That(address).Key("include_headers").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").HasValue("3"), + check.That(address).Key("override_agent_proxy").HasValue("false"), + check.That(address).Key("page_load_target_time").HasValue("6"), + check.That(address).Key("page_load_time_limit").HasValue("10"), + check.That(address).Key("page_loading_strategy").HasValue("normal"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").HasValue("false"), + check.That(address).Key("ssl_version_id").HasValue("0"), + check.That(address).Key("subinterval").HasValue("60"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_ntlm").Exists(), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("user_agent").HasValue("tfacc-user-agent"), + check.That(address).Key("verify_certificate").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/state.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/state.go new file mode 100644 index 00000000..b98b1fd1 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/state.go @@ -0,0 +1,125 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsPageLoadResourceModel, remote models.Tests_API_PageLoadTestResponseable) diag.Diagnostics { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return diags + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.AllowGeolocation = convert.PtrBoolToFramework(remote.GetAllowGeolocation()) + data.AllowMicAndCamera = convert.PtrBoolToFramework(remote.GetAllowMicAndCamera()) + data.AllowUnsafeLegacyRenegotiation = convert.PtrBoolToFramework(remote.GetAllowUnsafeLegacyRenegotiation()) + data.AuthType = convert.PtrStringerToFramework(remote.GetAuthType()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.BlockDomains = convert.PtrStringToFramework(remote.GetBlockDomains()) + data.BrowserLanguage = convert.PtrStringToFramework(remote.GetBrowserLanguage()) + data.ChromeOptions = convert.PtrStringToFramework(remote.GetChromeOptions()) + data.ClientCertificate = convert.PtrStringToFramework(remote.GetClientCertificate()) + data.CollectProxyNetworkData = convert.PtrBoolToFramework(remote.GetCollectProxyNetworkData()) + data.ContentRegex = convert.PtrStringToFramework(remote.GetContentRegex()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DesiredStatusCode = convert.PtrStringToFramework(remote.GetDesiredStatusCode()) + data.DisableScreenshot = convert.PtrBoolToFramework(remote.GetDisableScreenshot()) + data.DistributedTracing = convert.PtrBoolToFramework(remote.GetDistributedTracing()) + data.EmulatedDeviceID = convert.PtrStringToFramework(remote.GetEmulatedDeviceId()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FixedPacketRate = convert.PtrInt32ToFrameworkInt64(remote.GetFixedPacketRate()) + data.FollowRedirects = convert.PtrBoolToFramework(remote.GetFollowRedirects()) + data.HTTPInterval = convert.PtrInt32ToFrameworkInt64(remote.GetHttpInterval()) + data.HTTPTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTargetTime()) + data.HTTPTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTimeLimit()) + data.HTTPVersion = convert.PtrInt32ToFrameworkInt64(remote.GetHttpVersion()) + data.IdentifyAgentTrafficWithUserAgent = convert.PtrBoolToFramework(remote.GetIdentifyAgentTrafficWithUserAgent()) + data.IncludeHeaders = convert.PtrBoolToFramework(remote.GetIncludeHeaders()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.OverrideAgentProxy = convert.PtrBoolToFramework(remote.GetOverrideAgentProxy()) + data.OverrideProxyID = convert.PtrStringToFramework(remote.GetOverrideProxyId()) + data.PageLoadTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetPageLoadTargetTime()) + data.PageLoadTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetPageLoadTimeLimit()) + data.PageLoadingStrategy = convert.PtrStringerToFramework(remote.GetPageLoadingStrategy()) + data.Password = convert.PtrStringToFramework(remote.GetPassword()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.SSLVersion = convert.PtrStringToFramework(remote.GetSslVersion()) + data.SSLVersionID = convert.PtrStringerToFramework(remote.GetSslVersionId()) + data.Subinterval = convert.PtrInt32ToFrameworkInt64(remote.GetSubinterval()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.URL = convert.PtrStringToFramework(remote.GetUrl()) + data.UseNtlm = convert.PtrBoolToFramework(remote.GetUseNtlm()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + data.UserAgent = convert.PtrStringToFramework(remote.GetUserAgent()) + data.Username = convert.PtrStringToFramework(remote.GetUsername()) + data.VaultCredentials, d = flattenTestsPageLoadTestVaultCredentials(ctx, remote.GetVaultCredentials()) + diags.Append(d...) + data.VerifyCertificate = convert.PtrBoolToFramework(remote.GetVerifyCertificate()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) + + return diags +} + +// flattenTestsPageLoadTestVaultCredentials converts SDK structs into the framework value state holds. +func flattenTestsPageLoadTestVaultCredentials(ctx context.Context, in []models.Tests_API_TestVaultCredentialable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsPageLoadTestVaultCredentialObjectType), diags + } + + elements := make([]TestsPageLoadTestVaultCredentialModel, 0, len(in)) + for _, item := range in { + var m TestsPageLoadTestVaultCredentialModel + + m.SecretID = convert.PtrStringToFramework(item.GetSecretId()) + m.Target = convert.PtrStringerToFramework(item.GetTarget()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsPageLoadTestVaultCredentialObjectType, elements) + diags.Append(d2...) + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/test_helper_test.go new file mode 100644 index 00000000..7c702dce --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_page_load + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsPageLoadTestResource answers whether a thousandeyes_tests_page_load is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsPageLoadTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsPageLoadTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().PageLoad().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/maximal.tf new file mode 100644 index 00000000..322a023a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/maximal.tf @@ -0,0 +1,168 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_page_load" "test" { + # Where a value came from. + # + # alerts_enabled: the API's own default, so a value it is known to accept + # + # allow_geolocation: the API's own default, so a value it is known to accept + # + # allow_mic_and_camera: the API's own default, so a value it is known to accept + # + # allow_unsafe_legacy_renegotiation: the API's own default, so a value it is known to accept + # + # auth_type: documented; unprobed + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # bgp_measurements: the API's own default, so a value it is known to accept + # + # browser_language: the API's own default, so a value it is known to accept + # + # chrome_options: curated in the blueprint's accFixture; the generator cannot derive it + # + # collect_proxy_network_data: curated in the blueprint's accFixture; the generator cannot + # derive it + # + # desired_status_code: curated in the blueprint's accFixture; the generator cannot derive it + # + # disable_screenshot: the API's own default, so a value it is known to accept + # + # distributed_tracing: the API's own default, so a value it is known to accept + # + # dns_override: curated in the blueprint's accFixture; the generator cannot derive it + # + # emulated_device_id: the API's own default, so a value it is known to accept + # + # enabled: the API's own default, so a value it is known to accept + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # follow_redirects: the API's own default, so a value it is known to accept + # + # http_interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # http_target_time: the API's own default, so a value it is known to accept + # + # http_time_limit: the API's own default, so a value it is known to accept + # + # http_version: the API's own default, so a value it is known to accept + # + # identify_agent_traffic_with_user_agent: the API's own default, so a value it is known to + # accept + # + # include_headers: the API's own default, so a value it is known to accept + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # mtu_measurements: the API's own default, so a value it is known to accept + # + # num_path_traces: the API's own default, so a value it is known to accept + # + # override_agent_proxy: the API's own default, so a value it is known to accept + # + # page_load_target_time: the API's own default, so a value it is known to accept + # + # page_load_time_limit: the API's own default, so a value it is known to accept + # + # page_loading_strategy: documented; unprobed + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: observed accepted; the API refused udp + # + # randomized_start_time: the API's own default, so a value it is known to accept + # + # ssl_version_id: documented; unprobed + # + # subinterval: documented; unprobed + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_ntlm: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_public_bgp: the API's own default, so a value it is known to accept + # + # verify_certificate: the API's own default, so a value it is known to accept + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + # + # Not filled in, because no correct value could be derived. Each of these is optional, so this + # configuration is valid as it stands -- but it is testing less than it could. + # + # client_certificate: it is credential-shaped, and a generated fixture must not invent values + # that read as secrets; supply one through accFixture if the test needs it + # + # override_proxy_id: it references an object that must already exist, which a synthesised + # value cannot name; supply one through accFixture if the test has the object + # + # password: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # username: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # vault_credentials: a nested object's members may be identifiers of objects that must already + # exist, and nothing in the specification says whether they are + alerts_enabled = true + allow_geolocation = false + allow_mic_and_camera = false + allow_unsafe_legacy_renegotiation = true + auth_type = "none" + bandwidth_measurements = false + bgp_measurements = true + block_domains = "tfacc-block-domains" + browser_language = "en-US" + chrome_options = "--disable-gpu" + collect_proxy_network_data = false + content_regex = "tfacc-content-regex" + description = "tfacc-description" + desired_status_code = "200" + disable_screenshot = false + distributed_tracing = false + dns_override = "8.8.8.8" + download_limit = 1 + emulated_device_id = "281474976710656" + enabled = true + fixed_packet_rate = 50 + follow_redirects = true + http_interval = 3600 + http_target_time = 1000 + http_time_limit = 5 + http_version = 2 + identify_agent_traffic_with_user_agent = false + include_headers = true + interval = 3600 + mtu_measurements = true + num_path_traces = 3 + override_agent_proxy = false + page_load_target_time = 6 + page_load_time_limit = 10 + page_loading_strategy = "normal" + path_trace_mode = "classic" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + ssl_version_id = "0" + subinterval = "60" + test_name = "tfacc-test-name" + url = "https://www.example.com" + use_ntlm = false + use_public_bgp = true + user_agent = "tfacc-user-agent" + verify_certificate = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/minimal.tf new file mode 100644 index 00000000..eb8e6092 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/page_load_tests/v7/tests_page_load/testdata/minimal.tf @@ -0,0 +1,24 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_page_load" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/construct.go index e3e2673d..aaecc0da 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/crud.go index d1d9b8fc..4e000a90 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/model.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/model.go index 57eeda0e..075913af 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource.go index 4d0b6eb4..f645bd2a 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource_acceptance_test.go index ed51677c..2ca90a69 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/state.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/state.go index 51ada212..8181bf4c 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/test_helper_test.go index d6865025..6bbe20ef 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package role diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/maximal.tf index 78d08131..8891a5a2 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/minimal.tf index d646d8c2..cb8b27e1 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/roles/v7/role/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/construct.go new file mode 100644 index 00000000..9cccb9fb --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/construct.go @@ -0,0 +1,87 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsSIPServerResourceModel) (*models.Tests_API_SipServerTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_SipServerTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + ipv6PolicyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestIpv6Policy](data.Ipv6Policy, models.ParseTests_API_TestIpv6Policy) + diags.Append(d...) + body.SetIpv6Policy(ipv6PolicyRaw) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNetworkMeasurements(convert.FrameworkToPtrBool(data.NetworkMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetOptionsRegex(convert.FrameworkToPtrString(data.OptionsRegex)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetRegisterEnabled(convert.FrameworkToPtrBool(data.RegisterEnabled)) + body.SetSipTargetTime(convert.FrameworkInt64ToPtrInt32(data.SIPTargetTime)) + body.SetSipTimeLimit(convert.FrameworkInt64ToPtrInt32(data.SIPTimeLimit)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + agentsRaw, d := expandSipServerAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandSipServerAgents converts the configured SipServerAgentModel values into SDK structs. +func expandSipServerAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []SipServerAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/crud.go new file mode 100644 index 00000000..111945bc --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_sip_server. +func (r *TestsSIPServerResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsSIPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().SipServer().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_sip_server state from the API. +func (r *TestsSIPServerResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsSIPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_sip_server and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsSIPServerResource) readState( + ctx context.Context, + state *TestsSIPServerResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().SipServer().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsSIPServerResource) readAfterWrite( + ctx context.Context, + state *TestsSIPServerResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_sip_server. +func (r *TestsSIPServerResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsSIPServerResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().SipServer().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_sip_server. +func (r *TestsSIPServerResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsSIPServerResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().SipServer().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/model.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/model.go new file mode 100644 index 00000000..3073605f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/model.go @@ -0,0 +1,69 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsSIPServerResourceModel is the Terraform state for a thousandeyes_tests_sip_server. +// +// Field order follows the schema, and the timeouts value is last. +type TestsSIPServerResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + AuthUser types.String `tfsdk:"auth_user"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + Interval types.Int64 `tfsdk:"interval"` + Ipv6Policy types.String `tfsdk:"ipv6_policy"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + OptionsRegex types.String `tfsdk:"options_regex"` + Password types.String `tfsdk:"password"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + Port types.Int64 `tfsdk:"port"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + RegisterEnabled types.Bool `tfsdk:"register_enabled"` + SavedEvent types.Bool `tfsdk:"saved_event"` + SIPRegistrar types.String `tfsdk:"sip_registrar"` + SIPTargetTime types.Int64 `tfsdk:"sip_target_time"` + SIPTimeLimit types.Int64 `tfsdk:"sip_time_limit"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + User types.String `tfsdk:"user"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// SipServerAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type SipServerAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// sipServerAgentAttrTypes describes SipServerAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var sipServerAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var sipServerAgentObjectType = types.ObjectType{AttrTypes: sipServerAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource.go new file mode 100644 index 00000000..ff514dfe --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource.go @@ -0,0 +1,274 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_sip_server" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsSIPServerResource)(nil) + _ resource.ResourceWithConfigure = (*TestsSIPServerResource)(nil) + _ resource.ResourceWithImportState = (*TestsSIPServerResource)(nil) +) + +// NewTestsSIPServerResource returns the thousandeyes_tests_sip_server resource. +func NewTestsSIPServerResource() resource.Resource { + return &TestsSIPServerResource{} +} + +// TestsSIPServerResource implements the thousandeyes_tests_sip_server resource. +type TestsSIPServerResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsSIPServerResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsSIPServerResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsSIPServerResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsSIPServerResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get SIP Server test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates if alerts are enabled.", + }, + "auth_user": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Username for authentication with SIP server.", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Test is enabled. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + }, + "ipv6_policy": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "IP version policy. Overrides the IPv6 policy configured at the agent level. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("force-ipv4", "prefer-ipv6", "force-ipv6", "use-agent-policy"), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 " + + "or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Number of path traces executed by the agent. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "options_regex": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Options regex, this field does not require escaping.", + }, + "password": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Password for Basic/NTLM authentication.", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "port": schema.Int64Attribute{ + Computed: true, + MarkdownDescription: "Target port.", + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Transport layer for SIP communication.", + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "register_enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Set to true to perform SIP registration on the test target with the SIP REGISTER command.", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "sip_registrar": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "SIP server to be tested, specified by domain name or IP address.", + }, + "sip_target_time": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Target time for test completion in milliseconds.", + Validators: []validator.Int64{ + int64validator.Between(100, 5000), + }, + }, + "sip_time_limit": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Time limit in milliseconds.", + Validators: []validator.Int64{ + int64validator.Between(5, 10), + }, + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The name of the test. Test name must be unique.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "user": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Username for SIP registration, should be unique within a ThousandEyes account group.", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state.", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource_acceptance_test.go new file mode 100644 index 00000000..1b4697cc --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/resource_acceptance_test.go @@ -0,0 +1,119 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_sip_server.test" + +var testResource = tests_sip_server.TestsSIPServerTestResource{} + +// TestAccResourceTestsSIPServer_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsSIPServer_01_Lifecycle(t *testing.T) { + // This resource needs more privilege than the ordinary credential carries, so the + // gate is its own variable: a run against a lesser token skips it by name here, + // stated, instead of failing red for a reason that is about the token. + if os.Getenv("TFPFGEN_ACC_SIP") == "" { + t.Skipf("set TFPFGEN_ACC_SIP to run this test; it needs a more privileged credential") + } + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_sip_server", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("interval").Exists(), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("fixed_packet_rate").Exists(), + check.That(address).Key("interval").Exists(), + check.That(address).Key("ipv6_policy").HasValue("force-ipv4"), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("network_measurements").Exists(), + check.That(address).Key("num_path_traces").HasValue("1"), + check.That(address).Key("options_regex").HasValue("tfacc-options-regex"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("randomized_start_time").HasValue("true"), + check.That(address).Key("register_enabled").HasValue("true"), + check.That(address).Key("sip_target_time").HasValue("100"), + check.That(address).Key("sip_time_limit").HasValue("5"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("use_public_bgp").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/state.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/state.go new file mode 100644 index 00000000..b81f4c9a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/state.go @@ -0,0 +1,63 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsSIPServerResourceModel, remote models.Tests_API_SipServerTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.AuthUser = convert.PtrStringToFramework(remote.GetAuthUser()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FixedPacketRate = convert.PtrInt32ToFrameworkInt64(remote.GetFixedPacketRate()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.Ipv6Policy = convert.PtrStringerToFramework(remote.GetIpv6Policy()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.OptionsRegex = convert.PtrStringToFramework(remote.GetOptionsRegex()) + data.Password = convert.PtrStringToFramework(remote.GetPassword()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.Port = convert.PtrInt32ToFrameworkInt64(remote.GetPort()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.RegisterEnabled = convert.PtrBoolToFramework(remote.GetRegisterEnabled()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.SIPRegistrar = convert.PtrStringToFramework(remote.GetSipRegistrar()) + data.SIPTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetSipTargetTime()) + data.SIPTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetSipTimeLimit()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + data.User = convert.PtrStringToFramework(remote.GetUser()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/test_helper_test.go new file mode 100644 index 00000000..61ee26cc --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_sip_server + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsSIPServerTestResource answers whether a thousandeyes_tests_sip_server is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsSIPServerTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsSIPServerTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().SipServer().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/maximal.tf new file mode 100644 index 00000000..4edc2449 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/maximal.tf @@ -0,0 +1,49 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_sip_server" "test" { + # Where a value came from. + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # ipv6_policy: documented; unprobed + # + # network_measurements: curated in the blueprint's accFixture; the generator cannot derive it + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + alerts_enabled = true + bgp_measurements = true + description = "tfacc-description" + enabled = true + fixed_packet_rate = 50 + interval = 3600 + ipv6_policy = "force-ipv4" + mtu_measurements = true + network_measurements = false + num_path_traces = 1 + options_regex = "tfacc-options-regex" + path_trace_mode = "classic" + probe_mode = "auto" + randomized_start_time = true + register_enabled = true + sip_target_time = 100 + sip_time_limit = 5 + test_name = "tfacc-test-name" + use_public_bgp = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/minimal.tf new file mode 100644 index 00000000..914ce0a5 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/sip_server_tests/v7/tests_sip_server/testdata/minimal.tf @@ -0,0 +1,21 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_sip_server" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/conditional_validators.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/conditional_validators.go index e5ba3b8a..72cb20f2 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/conditional_validators.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/conditional_validators.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/construct.go index c611ff6f..316acded 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/crud.go index 04ff22b5..60887457 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_acceptance_test.go index b6daf7f1..15b8edf0 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_resource.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_resource.go index 09054707..ae9ed845 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/list_resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/model.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/model.go index 3b121738..acfaf11a 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. // REF: https://developer.cisco.com/docs/thousandeyes/list-tags/ package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource.go index 2dcc3b16..87415811 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource_acceptance_test.go index 1955d782..bb2fa1c1 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/state.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/state.go index ae96f8d6..66311b81 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/test_helper_test.go index 55015087..2cf44910 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package tag diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/maximal.tf index 08acfa11..ee6c40da 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/minimal.tf index eb3dabea..2082f674 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/query.tf b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/query.tf index 4b25e123..6cec5939 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/query.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/query.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The query configuration: one list block over the whole collection. The provider block # is explicit because the list block references it by symbol, unlike a resource step diff --git a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/replace.tf b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/replace.tf index f0fcb825..959a23b9 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/replace.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/tags/v7/tag/testdata/replace.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/construct.go index 821d815b..d9df4862 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/construct.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/construct.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/crud.go index 05191e40..12a9e5f4 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/crud.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/crud.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/model.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/model.go index 28a3808e..6bbd62f4 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/model.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/model.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource.go index 1026fcb0..dc4c20f9 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource_acceptance_test.go index ea0815f0..beeb4c34 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource_acceptance_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/resource_acceptance_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user_test diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/state.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/state.go index ccc20297..88bddb2f 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/state.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/state.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/test_helper_test.go index c2a879da..4d2adaa3 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/test_helper_test.go +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/test_helper_test.go @@ -1,5 +1,5 @@ // Code generated by tfpfgen from blueprints/thousandeyes-kiota -// (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. package user diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/maximal.tf index d090dec0..a97cb2de 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/maximal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/maximal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The widest configuration the evidence supports: every writable attribute with a derivable # value, chosen by the same derivation the rehearsal probe sends to the live API. diff --git a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/minimal.tf index 08190565..6ed9bea1 100644 --- a/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/minimal.tf +++ b/pilot/thousandeyes-kiota/internal/services/resources/users/v7/user/testdata/minimal.tf @@ -1,5 +1,5 @@ # Code generated by tfpfgen from blueprints/thousandeyes-kiota -# (sha256:434ad04ce572e36db37385f5f233e261de50e3736b4a1586468ad4a66a893ca5). DO NOT EDIT. +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. # The smallest configuration this resource accepts: its required attributes and nothing else. # diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/construct.go new file mode 100644 index 00000000..564e2613 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/construct.go @@ -0,0 +1,79 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsVoiceResourceModel) (*models.Tests_API_VoiceTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_VoiceTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetCodecId(convert.FrameworkToPtrString(data.CodecID)) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + dscpIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestDscpId](data.DscpID, models.ParseTests_API_TestDscpId) + diags.Append(d...) + body.SetDscpId(dscpIDRaw) + body.SetDuration(convert.FrameworkInt64ToPtrInt32(data.Duration)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetJitterBuffer(convert.FrameworkInt64ToPtrInt32(data.JitterBuffer)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetPort(convert.FrameworkInt64ToPtrInt32(data.Port)) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + body.SetTargetAgentId(convert.FrameworkToPtrString(data.TargetAgentID)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + agentsRaw, d := expandVoiceAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandVoiceAgents converts the configured VoiceAgentModel values into SDK structs. +func expandVoiceAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []VoiceAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/crud.go new file mode 100644 index 00000000..b1814f96 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_voice. +func (r *TestsVoiceResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsVoiceResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().Voice().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_voice state from the API. +func (r *TestsVoiceResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsVoiceResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_voice and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsVoiceResource) readState( + ctx context.Context, + state *TestsVoiceResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().Voice().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + mapRemoteStateToTerraform(ctx, state, remote) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsVoiceResource) readAfterWrite( + ctx context.Context, + state *TestsVoiceResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_voice. +func (r *TestsVoiceResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsVoiceResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().Voice().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_voice. +func (r *TestsVoiceResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsVoiceResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().Voice().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/model.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/model.go new file mode 100644 index 00000000..39df7f60 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/model.go @@ -0,0 +1,61 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsVoiceResourceModel is the Terraform state for a thousandeyes_tests_voice. +// +// Field order follows the schema, and the timeouts value is last. +type TestsVoiceResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + Codec types.String `tfsdk:"codec"` + CodecID types.String `tfsdk:"codec_id"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Description types.String `tfsdk:"description"` + Dscp types.String `tfsdk:"dscp"` + DscpID types.String `tfsdk:"dscp_id"` + Duration types.Int64 `tfsdk:"duration"` + Enabled types.Bool `tfsdk:"enabled"` + Interval types.Int64 `tfsdk:"interval"` + JitterBuffer types.Int64 `tfsdk:"jitter_buffer"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + Port types.Int64 `tfsdk:"port"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + TargetAgentID types.String `tfsdk:"target_agent_id"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + Type types.String `tfsdk:"type"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// VoiceAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type VoiceAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// voiceAgentAttrTypes describes VoiceAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var voiceAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var voiceAgentObjectType = types.ObjectType{AttrTypes: voiceAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/resource.go new file mode 100644 index 00000000..54e25872 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/resource.go @@ -0,0 +1,230 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_voice" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsVoiceResource)(nil) + _ resource.ResourceWithConfigure = (*TestsVoiceResource)(nil) + _ resource.ResourceWithImportState = (*TestsVoiceResource)(nil) +) + +// NewTestsVoiceResource returns the thousandeyes_tests_voice resource. +func NewTestsVoiceResource() resource.Resource { + return &TestsVoiceResource{} +} + +// TestsVoiceResource implements the thousandeyes_tests_voice resource. +type TestsVoiceResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsVoiceResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsVoiceResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsVoiceResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsVoiceResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get Voice test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates if alerts are enabled.", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "codec": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Codec label", + }, + "codec_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Codec identifier for the RTP stream. Valid values: * `0`: G.711 @ 64 Kbps * `1`: G.722.1 @ " + + "24 Kbps (WB) * `2`: G.722.1 @ 32 Kbps (WB) * `3`: G.726 @ 32 Kbps * `4`: G.723.1 @ 6.4 " + + "Kbps * `5`: G.729a @ 8 Kbps * `6`: RTAudio @ 45 Kbps (WB) * `7`: RTAudio @ 27.8 Kbps * " + + "`8`: SILK @ 36 Kbps (WB) * `9`: G.722 @ 64 Kbps (WB)", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "dscp": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "DSCP label.", + }, + "dscp_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "DSCP ID [to see list for acceptable " + + "values](https://docs.thousandeyes.com/product-documentation/tests/dscp-options-in-network-tests) " + + " The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "8", "16", "24", "32", "40", "48", "56", "10", "12", "14", "18", "20", "22", "26", "28", "30", "34", "36", "38", "46", "44"), + }, + }, + "duration": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Duration of the test in seconds.", + Validators: []validator.Int64{ + int64validator.Between(5, 30), + }, + }, + "enabled": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Test is enabled. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + }, + "jitter_buffer": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "De-jitter buffer size in seconds.", + Validators: []validator.Int64{ + int64validator.Between(0, 150), + }, + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Number of path traces executed by the agent. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "port": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Port number for the chosen protocol.", + Validators: []validator.Int64{ + int64validator.Between(1024, 65535), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "target_agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "Agent ID of the target agent for the test.", + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The name of the test. Test name must be unique.", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state.", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/state.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/state.go new file mode 100644 index 00000000..fe4b87ea --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/state.go @@ -0,0 +1,55 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsVoiceResourceModel, remote models.Tests_API_VoiceTestResponseable) { + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.Codec = convert.PtrStringToFramework(remote.GetCodec()) + data.CodecID = convert.PtrStringToFramework(remote.GetCodecId()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.Dscp = convert.PtrStringToFramework(remote.GetDscp()) + data.DscpID = convert.PtrStringerToFramework(remote.GetDscpId()) + data.Duration = convert.PtrInt32ToFrameworkInt64(remote.GetDuration()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.JitterBuffer = convert.PtrInt32ToFrameworkInt64(remote.GetJitterBuffer()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.Port = convert.PtrInt32ToFrameworkInt64(remote.GetPort()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.TargetAgentID = convert.PtrStringToFramework(remote.GetTargetAgentId()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/test_helper_test.go new file mode 100644 index 00000000..78d91536 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/voice_tests/v7/tests_voice/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_voice + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsVoiceTestResource answers whether a thousandeyes_tests_voice is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsVoiceTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsVoiceTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().Voice().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/construct.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/construct.go new file mode 100644 index 00000000..3219ac76 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/construct.go @@ -0,0 +1,161 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// constructResource maps Terraform configuration onto the API's request body. +// +// Only writable attributes appear here. A computed attribute has no expand +// conversion, so it cannot be sent by construction rather than by discipline. +func constructResource(ctx context.Context, data *TestsWebTransactionResourceModel) (*models.Tests_API_WebTransactionTestRequest, diag.Diagnostics) { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + tflog.Debug(ctx, "constructing request body", map[string]any{"resource": TypeName}) + + body := models.NewTests_API_WebTransactionTestRequest() + + body.SetAlertsEnabled(convert.FrameworkToPtrBool(data.AlertsEnabled)) + body.SetAllowGeolocation(convert.FrameworkToPtrBool(data.AllowGeolocation)) + body.SetAllowMicAndCamera(convert.FrameworkToPtrBool(data.AllowMicAndCamera)) + body.SetAllowUnsafeLegacyRenegotiation(convert.FrameworkToPtrBool(data.AllowUnsafeLegacyRenegotiation)) + authTypeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestAuthType](data.AuthType, models.ParseTests_API_TestAuthType) + diags.Append(d...) + body.SetAuthType(authTypeRaw) + body.SetBandwidthMeasurements(convert.FrameworkToPtrBool(data.BandwidthMeasurements)) + body.SetBgpMeasurements(convert.FrameworkToPtrBool(data.BGPMeasurements)) + body.SetBlockDomains(convert.FrameworkToPtrString(data.BlockDomains)) + body.SetBrowserLanguage(convert.FrameworkToPtrString(data.BrowserLanguage)) + body.SetChromeOptions(convert.FrameworkToPtrString(data.ChromeOptions)) + body.SetClientCertificate(convert.FrameworkToPtrString(data.ClientCertificate)) + body.SetCollectProxyNetworkData(convert.FrameworkToPtrBool(data.CollectProxyNetworkData)) + body.SetContentRegex(convert.FrameworkToPtrString(data.ContentRegex)) + credentialsRaw, d := convert.FrameworkSetToStringSlice(ctx, data.Credentials) + diags.Append(d...) + body.SetCredentials(credentialsRaw) + body.SetDescription(convert.FrameworkToPtrString(data.Description)) + body.SetDesiredStatusCode(convert.FrameworkToPtrString(data.DesiredStatusCode)) + body.SetDisableScreenshot(convert.FrameworkToPtrBool(data.DisableScreenshot)) + body.SetDistributedTracing(convert.FrameworkToPtrBool(data.DistributedTracing)) + body.SetDnsOverride(convert.FrameworkToPtrString(data.DNSOverride)) + body.SetDownloadLimit(convert.FrameworkInt64ToPtrInt32(data.DownloadLimit)) + body.SetEmulatedDeviceId(convert.FrameworkToPtrString(data.EmulatedDeviceID)) + body.SetEnabled(convert.FrameworkToPtrBool(data.Enabled)) + body.SetFixedPacketRate(convert.FrameworkInt64ToPtrInt32(data.FixedPacketRate)) + body.SetFollowRedirects(convert.FrameworkToPtrBool(data.FollowRedirects)) + body.SetHttpTargetTime(convert.FrameworkInt64ToPtrInt32(data.HTTPTargetTime)) + body.SetHttpTimeLimit(convert.FrameworkInt64ToPtrInt32(data.HTTPTimeLimit)) + body.SetHttpVersion(convert.FrameworkInt64ToPtrInt32(data.HTTPVersion)) + body.SetIdentifyAgentTrafficWithUserAgent(convert.FrameworkToPtrBool(data.IdentifyAgentTrafficWithUserAgent)) + body.SetIncludeHeaders(convert.FrameworkToPtrBool(data.IncludeHeaders)) + body.SetInterval(convert.FrameworkInt64ToPtrInt32(data.Interval)) + body.SetMtuMeasurements(convert.FrameworkToPtrBool(data.MTUMeasurements)) + body.SetNumPathTraces(convert.FrameworkInt64ToPtrInt32(data.NumPathTraces)) + body.SetOverrideAgentProxy(convert.FrameworkToPtrBool(data.OverrideAgentProxy)) + body.SetOverrideProxyId(convert.FrameworkToPtrString(data.OverrideProxyID)) + pageLoadingStrategyRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPageLoadingStrategy](data.PageLoadingStrategy, models.ParseTests_API_TestPageLoadingStrategy) + diags.Append(d...) + body.SetPageLoadingStrategy(pageLoadingStrategyRaw) + body.SetPassword(convert.FrameworkToPtrString(data.Password)) + pathTraceModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestPathTraceMode](data.PathTraceMode, models.ParseTests_API_TestPathTraceMode) + diags.Append(d...) + body.SetPathTraceMode(pathTraceModeRaw) + probeModeRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProbeMode](data.ProbeMode, models.ParseTests_API_TestProbeMode) + diags.Append(d...) + body.SetProbeMode(probeModeRaw) + protocolRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestProtocol](data.Protocol, models.ParseTests_API_TestProtocol) + diags.Append(d...) + body.SetProtocol(protocolRaw) + body.SetRandomizedStartTime(convert.FrameworkToPtrBool(data.RandomizedStartTime)) + sSLVersionIDRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestSslVersionId](data.SSLVersionID, models.ParseTests_API_TestSslVersionId) + diags.Append(d...) + body.SetSslVersionId(sSLVersionIDRaw) + body.SetSubinterval(convert.FrameworkInt64ToPtrInt32(data.Subinterval)) + body.SetTargetTime(convert.FrameworkInt64ToPtrInt32(data.TargetTime)) + body.SetTestName(convert.FrameworkToPtrString(data.TestName)) + body.SetTimeLimit(convert.FrameworkInt64ToPtrInt32(data.TimeLimit)) + body.SetTransactionScript(convert.FrameworkToPtrString(data.TransactionScript)) + body.SetUrl(convert.FrameworkToPtrString(data.URL)) + body.SetUseNtlm(convert.FrameworkToPtrBool(data.UseNtlm)) + body.SetUsePublicBgp(convert.FrameworkToPtrBool(data.UsePublicBGP)) + body.SetUserAgent(convert.FrameworkToPtrString(data.UserAgent)) + body.SetUsername(convert.FrameworkToPtrString(data.Username)) + vaultCredentialsRaw, d := expandTestsWebTransactionTestVaultCredentials(ctx, data.VaultCredentials) + diags.Append(d...) + body.SetVaultCredentials(vaultCredentialsRaw) + body.SetVerifyCertificate(convert.FrameworkToPtrBool(data.VerifyCertificate)) + agentsRaw, d := expandWebTransactionAgents(ctx, data.Agents) + diags.Append(d...) + body.SetAgents(agentsRaw) + + return body, diags +} + +// expandTestsWebTransactionTestVaultCredentials converts the configured TestsWebTransactionTestVaultCredentialModel values into SDK structs. +func expandTestsWebTransactionTestVaultCredentials(ctx context.Context, v types.Set) ([]models.Tests_API_TestVaultCredentialable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []TestsWebTransactionTestVaultCredentialModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestVaultCredentialable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestVaultCredential() + + item.SetSecretId(convert.FrameworkToPtrString(m.SecretID)) + targetRaw, d := convert.FrameworkToKiotaEnum[models.Tests_API_TestVaultCredentialTarget](m.Target, models.ParseTests_API_TestVaultCredentialTarget) + diags.Append(d...) + item.SetTarget(targetRaw) + out = append(out, item) + } + + return out, diags +} + +// expandWebTransactionAgents converts the configured WebTransactionAgentModel values into SDK structs. +func expandWebTransactionAgents(ctx context.Context, v types.Set) ([]models.Tests_API_TestAgentRequestable, diag.Diagnostics) { + var diags diag.Diagnostics + + // Null and unknown both yield nil so the field is omitted from the request, + // which is distinct from an empty collection asking the API to clear it. + if v.IsNull() || v.IsUnknown() { + return nil, diags + } + + var elements []WebTransactionAgentModel + diags.Append(v.ElementsAs(ctx, &elements, false)...) + if diags.HasError() { + return nil, diags + } + + out := make([]models.Tests_API_TestAgentRequestable, 0, len(elements)) + for _, m := range elements { + item := models.NewTests_API_TestAgentRequest() + + item.SetAgentId(convert.FrameworkToPtrString(m.AgentID)) + out = append(out, item) + } + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/crud.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/crud.go new file mode 100644 index 00000000..020fc228 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/crud.go @@ -0,0 +1,266 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "context" + "time" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-log/tflog" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/crud" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/errors" +) + +// Create provisions a new thousandeyes_tests_web_transaction. +func (r *TestsWebTransactionResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) { + var plan TestsWebTransactionResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "creating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseCreate, CreateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + created, err := r.client.Tests().WebTransactions().Post(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, err) + return + } + + // An empty success body cannot be recorded: without a response there is no + // identifier, and inventing one would orphan whatever the API just created. + if created == nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpCreate, errors.ErrEmptyResponse) + return + } + + // The identifier is assigned first, so that a partially-successful create still + // leaves a resource Terraform can find and delete rather than an orphan it has no + // record of. + plan.ID = convert.PtrStringToFramework(created.GetTestId()) + + // State comes from a read, not from the create response. The two are not + // interchangeable: a field the API only returns when asked to expand it is absent + // from a create response, so mapping that response would write it null and the next + // read would contradict it -- a diff no configuration change can resolve. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpCreate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Read refreshes thousandeyes_tests_web_transaction state from the API. +func (r *TestsWebTransactionResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse) { + var state TestsWebTransactionResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "reading resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseRead, ReadTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + found, diags := r.readState(ctx, &state, errors.OpRead) + resp.Diagnostics.Append(diags...) + if resp.Diagnostics.HasError() { + return + } + + // Something deleted outside Terraform must produce a plan that recreates it, not an + // error the practitioner has no way to clear. + if !found { + tflog.Debug(ctx, "resource no longer exists, removing it from state", map[string]any{ + "resource": TypeName, + }) + resp.State.RemoveResource(ctx) + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &state)...) +} + +// readState fetches thousandeyes_tests_web_transaction and maps it onto state. +// +// The single call site of mapRemoteStateToTerraform. Create, Update and Read all arrive +// here, so a change to state mapping is one edit rather than three that have to agree. +// +// The bool distinguishes "not there" from "the request failed", which need different +// handling and used to be conflated: Read turns absence into a recreate, while a read +// after a write treats it as not-yet-consistent and tries again. +func (r *TestsWebTransactionResource) readState( + ctx context.Context, + state *TestsWebTransactionResourceModel, + op errors.Operation, +) (bool, diag.Diagnostics) { + var diags diag.Diagnostics + + remote, err := r.client.Tests().WebTransactions().ByTestId(state.ID.ValueString()).Get(ctx, nil) + if err != nil { + if errors.IsNotFound(err) { + return false, diags + } + + errors.Handle(&diags, TypeName, op, err) + + return false, diags + } + + // An empty success body means the object is gone as far as this provider can + // tell; treat it exactly like a not-found rather than mapping nothing. + if remote == nil { + return false, diags + } + diags.Append(mapRemoteStateToTerraform(ctx, state, remote)...) + + return true, diags +} + +// readAfterWrite refreshes state from the API after a create or an update, retrying while +// the object is not yet readable. +// +// Why a read at all, rather than mapping the write's own response: the two are not +// interchangeable. A field the API only returns when asked to expand it is absent from a +// write response, so mapping that response writes it null and the next read contradicts +// it. The pilot's own probe evidence says so. +// +// Why a retry: an API that is not read-your-writes consistent returns 404 for an object it +// has just created, and a create that reports success on state the next plan disagrees with +// is worse than one that waits. +// +// The budget is the built-in default: this API's consistency has not been measured, so +// there is no observation to size it from. An API that is consistent succeeds on the first +// attempt and pays nothing for the loop. +func (r *TestsWebTransactionResource) readAfterWrite( + ctx context.Context, + state *TestsWebTransactionResourceModel, + op errors.Operation, +) diag.Diagnostics { + var diags diag.Diagnostics + + opts := crud.ReadBackOptions{ + MaxRetries: 10, + Interval: 2000 * time.Millisecond, + ResourceType: TypeName, + Operation: string(op), + } + + err := crud.ReadBack(ctx, opts, func(ctx context.Context) (bool, error) { + found, d := r.readState(ctx, state, op) + diags.Append(d...) + + if d.HasError() { + return false, crud.ErrStopRetrying + } + + return found, nil + }) + + // A stop signal means readState has already produced the diagnostic, so reporting + // here as well would say the same thing twice. + if err != nil && !crud.IsStopRetrying(err) { + errors.Handle(&diags, TypeName, op, err) + } + + return diags +} + +// Update applies configuration changes to an existing thousandeyes_tests_web_transaction. +func (r *TestsWebTransactionResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse) { + var plan, state TestsWebTransactionResourceModel + + resp.Diagnostics.Append(req.Plan.Get(ctx, &plan)...) + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "updating resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, plan.Timeouts, crud.PhaseUpdate, UpdateTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + body, constructDiags := constructResource(ctx, &plan) + resp.Diagnostics.Append(constructDiags...) + if resp.Diagnostics.HasError() { + return + } + + _, err := r.client.Tests().WebTransactions().ByTestId(state.ID.ValueString()).Put(ctx, body, nil) + if err != nil { + errors.Handle(&resp.Diagnostics, TypeName, errors.OpUpdate, err) + return + } + + // The plan carries no identifier, since it is computed. Carrying it over from + // prior state keeps it in the model in case the response omits it. + plan.ID = state.ID + + // As with create: state comes from a read rather than from the update response. + resp.Diagnostics.Append(r.readAfterWrite(ctx, &plan, errors.OpUpdate)...) + if resp.Diagnostics.HasError() { + return + } + + resp.Diagnostics.Append(resp.State.Set(ctx, &plan)...) +} + +// Delete removes a thousandeyes_tests_web_transaction. +func (r *TestsWebTransactionResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse) { + var state TestsWebTransactionResourceModel + + resp.Diagnostics.Append(req.State.Get(ctx, &state)...) + if resp.Diagnostics.HasError() { + return + } + + tflog.Debug(ctx, "deleting resource", map[string]any{"resource": TypeName}) + + timeout := crud.Timeout(ctx, state.Timeouts, crud.PhaseDelete, DeleteTimeout*time.Second, &resp.Diagnostics) + if resp.Diagnostics.HasError() { + return + } + ctx, cancel := context.WithTimeout(ctx, timeout) + defer cancel() + + err := r.client.Tests().WebTransactions().ByTestId(state.ID.ValueString()).Delete(ctx, nil) + if err != nil { + // Already gone is the outcome delete was asking for. + if errors.IsNotFound(err) { + return + } + errors.Handle(&resp.Diagnostics, TypeName, errors.OpDelete, err) + return + } + + // State is removed by the framework once Delete returns without error. +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/model.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/model.go new file mode 100644 index 00000000..9eba8103 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/model.go @@ -0,0 +1,119 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "github.com/hashicorp/terraform-plugin-framework-timeouts/resource/timeouts" + "github.com/hashicorp/terraform-plugin-framework/attr" + "github.com/hashicorp/terraform-plugin-framework/types" +) + +// TestsWebTransactionResourceModel is the Terraform state for a thousandeyes_tests_web_transaction. +// +// Field order follows the schema, and the timeouts value is last. +type TestsWebTransactionResourceModel struct { + AlertsEnabled types.Bool `tfsdk:"alerts_enabled"` + AllowGeolocation types.Bool `tfsdk:"allow_geolocation"` + AllowMicAndCamera types.Bool `tfsdk:"allow_mic_and_camera"` + AllowUnsafeLegacyRenegotiation types.Bool `tfsdk:"allow_unsafe_legacy_renegotiation"` + AuthType types.String `tfsdk:"auth_type"` + BandwidthMeasurements types.Bool `tfsdk:"bandwidth_measurements"` + BGPMeasurements types.Bool `tfsdk:"bgp_measurements"` + BlockDomains types.String `tfsdk:"block_domains"` + BrowserLanguage types.String `tfsdk:"browser_language"` + ChromeOptions types.String `tfsdk:"chrome_options"` + ClientCertificate types.String `tfsdk:"client_certificate"` + CollectProxyNetworkData types.Bool `tfsdk:"collect_proxy_network_data"` + ContentRegex types.String `tfsdk:"content_regex"` + CreatedBy types.String `tfsdk:"created_by"` + CreatedDate types.String `tfsdk:"created_date"` + Credentials types.Set `tfsdk:"credentials"` + Description types.String `tfsdk:"description"` + DesiredStatusCode types.String `tfsdk:"desired_status_code"` + DisableScreenshot types.Bool `tfsdk:"disable_screenshot"` + DistributedTracing types.Bool `tfsdk:"distributed_tracing"` + DNSOverride types.String `tfsdk:"dns_override"` + DownloadLimit types.Int64 `tfsdk:"download_limit"` + EmulatedDeviceID types.String `tfsdk:"emulated_device_id"` + Enabled types.Bool `tfsdk:"enabled"` + FixedPacketRate types.Int64 `tfsdk:"fixed_packet_rate"` + FollowRedirects types.Bool `tfsdk:"follow_redirects"` + HTTPTargetTime types.Int64 `tfsdk:"http_target_time"` + HTTPTimeLimit types.Int64 `tfsdk:"http_time_limit"` + HTTPVersion types.Int64 `tfsdk:"http_version"` + IdentifyAgentTrafficWithUserAgent types.Bool `tfsdk:"identify_agent_traffic_with_user_agent"` + IncludeHeaders types.Bool `tfsdk:"include_headers"` + Interval types.Int64 `tfsdk:"interval"` + LiveShare types.Bool `tfsdk:"live_share"` + ModifiedBy types.String `tfsdk:"modified_by"` + ModifiedDate types.String `tfsdk:"modified_date"` + MTUMeasurements types.Bool `tfsdk:"mtu_measurements"` + NetworkMeasurements types.Bool `tfsdk:"network_measurements"` + NumPathTraces types.Int64 `tfsdk:"num_path_traces"` + OverrideAgentProxy types.Bool `tfsdk:"override_agent_proxy"` + OverrideProxyID types.String `tfsdk:"override_proxy_id"` + PageLoadingStrategy types.String `tfsdk:"page_loading_strategy"` + Password types.String `tfsdk:"password"` + PathTraceMode types.String `tfsdk:"path_trace_mode"` + ProbeMode types.String `tfsdk:"probe_mode"` + Protocol types.String `tfsdk:"protocol"` + RandomizedStartTime types.Bool `tfsdk:"randomized_start_time"` + SavedEvent types.Bool `tfsdk:"saved_event"` + SSLVersion types.String `tfsdk:"ssl_version"` + SSLVersionID types.String `tfsdk:"ssl_version_id"` + Subinterval types.Int64 `tfsdk:"subinterval"` + TargetTime types.Int64 `tfsdk:"target_time"` + ID types.String `tfsdk:"id"` + TestName types.String `tfsdk:"test_name"` + TimeLimit types.Int64 `tfsdk:"time_limit"` + TransactionScript types.String `tfsdk:"transaction_script"` + Type types.String `tfsdk:"type"` + URL types.String `tfsdk:"url"` + UseNtlm types.Bool `tfsdk:"use_ntlm"` + UsePublicBGP types.Bool `tfsdk:"use_public_bgp"` + UserAgent types.String `tfsdk:"user_agent"` + Username types.String `tfsdk:"username"` + VaultCredentials types.Set `tfsdk:"vault_credentials"` + VerifyCertificate types.Bool `tfsdk:"verify_certificate"` + Agents types.Set `tfsdk:"agents"` + Timeouts timeouts.Value `tfsdk:"timeouts"` +} + +// TestsWebTransactionTestVaultCredentialModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type TestsWebTransactionTestVaultCredentialModel struct { + SecretID types.String `tfsdk:"secret_id"` + Target types.String `tfsdk:"target"` +} + +// testsWebTransactionTestVaultCredentialAttrTypes describes TestsWebTransactionTestVaultCredentialModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var testsWebTransactionTestVaultCredentialAttrTypes = map[string]attr.Type{ + "secret_id": types.StringType, + "target": types.StringType, +} + +var testsWebTransactionTestVaultCredentialObjectType = types.ObjectType{AttrTypes: testsWebTransactionTestVaultCredentialAttrTypes} + +// WebTransactionAgentModel is one element of a nested attribute. +// +// It is a sibling of the resource model rather than an inner type, because the +// framework decodes collection elements into a named type. +type WebTransactionAgentModel struct { + AgentID types.String `tfsdk:"agent_id"` +} + +// webTransactionAgentAttrTypes describes WebTransactionAgentModel to the framework. +// +// It is declared once and referenced by both conversion helpers, so the shape +// cannot drift between the direction that reads it and the direction that writes it. +var webTransactionAgentAttrTypes = map[string]attr.Type{ + "agent_id": types.StringType, +} + +var webTransactionAgentObjectType = types.ObjectType{AttrTypes: webTransactionAgentAttrTypes} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource.go new file mode 100644 index 00000000..3ca53e34 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource.go @@ -0,0 +1,616 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework-validators/int64validator" + "github.com/hashicorp/terraform-plugin-framework-validators/stringvalidator" + "github.com/hashicorp/terraform-plugin-framework/path" + "github.com/hashicorp/terraform-plugin-framework/resource" + "github.com/hashicorp/terraform-plugin-framework/resource/schema" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/planmodifier" + "github.com/hashicorp/terraform-plugin-framework/resource/schema/stringplanmodifier" + "github.com/hashicorp/terraform-plugin-framework/schema/validator" + "github.com/hashicorp/terraform-plugin-framework/types" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/client" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" + commonschema "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/schema" +) + +const ( + // TypeName is the Terraform type this resource registers as. + TypeName = "thousandeyes_tests_web_transaction" + + // Default per-operation timeouts, in seconds. A practitioner overrides them + // with the resource's timeouts block. + CreateTimeout = 180 + ReadTimeout = 180 + UpdateTimeout = 180 + DeleteTimeout = 180 +) + +// Compile-time assertions that this resource implements what it claims to. They +// turn a missing method into a build failure rather than a runtime surprise. +var ( + _ resource.Resource = (*TestsWebTransactionResource)(nil) + _ resource.ResourceWithConfigure = (*TestsWebTransactionResource)(nil) + _ resource.ResourceWithImportState = (*TestsWebTransactionResource)(nil) +) + +// NewTestsWebTransactionResource returns the thousandeyes_tests_web_transaction resource. +func NewTestsWebTransactionResource() resource.Resource { + return &TestsWebTransactionResource{} +} + +// TestsWebTransactionResource implements the thousandeyes_tests_web_transaction resource. +type TestsWebTransactionResource struct { + client *sdk.ThousandEyesClient +} + +// Metadata returns the resource type name. +func (r *TestsWebTransactionResource) Metadata(_ context.Context, _ resource.MetadataRequest, resp *resource.MetadataResponse) { + resp.TypeName = TypeName +} + +// Configure receives the configured SDK client from the provider. +func (r *TestsWebTransactionResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse) { + r.client = client.ForResource(ctx, req, resp, TypeName) +} + +// ImportState maps a terraform import into state. +func (r *TestsWebTransactionResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse) { + resource.ImportStatePassthroughID(ctx, path.Root("id"), req, resp) +} + +// Schema returns the resource schema. +func (r *TestsWebTransactionResource) Schema(ctx context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) { + resp.Schema = schema.Schema{ + MarkdownDescription: "Get Web Transactions test.", + Attributes: map[string]schema.Attribute{ + "alerts_enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates if alerts are enabled. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted.", + }, + "allow_geolocation": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set true to use the agent’s geolocation by the web page. Computed as well as optional: " + + "the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value " + + "when this is omitted. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "allow_mic_and_camera": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set true allow the use of a fake mic and camera in the browser. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "allow_unsafe_legacy_renegotiation": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Allows TLS renegotiation with servers not supporting RFC 5746. Default Set to true to " + + "allow unsafe legacy renegotiation. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "auth_type": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP authentication type. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("none", "basic", "ntlm", "kerberos", "oauth"), + }, + }, + "bandwidth_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bandwidth measurements, only applies to Enterprise agents assigned " + + "to the test. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) " + + "observed the API applying its own value when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "bgp_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to enable bgp measurements. Computed as well as optional: the 2026-08-03 " + + "dispatched acceptance run (#12) observed the API applying its own value when this is " + + "omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "block_domains": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Domains or full object URLs to be excluded from metrics and waterfall data for transaction " + + "tests. The SDK's encoding drops this type's zero value (omitempty), " + + "so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "browser_language": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set one of the available browser language that you want to use to configure the browser. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "chrome_options": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Command-line options passed to Chrome when running the test. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "client_certificate": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "String representation (containing newline characters) of client certificate, the private " + + "key must be placed first, then the certificate. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "collect_proxy_network_data": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether network data to the proxy should be collected. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "content_regex": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Content regex, this field does not require escaping. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "created_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that created the test.", + }, + "created_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC created date (ISO date-time format).", + }, + "credentials": schema.SetAttribute{ + ElementType: types.StringType, + Optional: true, + MarkdownDescription: "Contains a list of credential IDs (get `credentialId` from `/credentials` endpoint).", + }, + "description": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "A description of the test.", + }, + "desired_status_code": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Specify the HTTP status code value that indicates a successful response. The default value " + + "accepts any 2xx or 3xx status code. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "disable_screenshot": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Enables or disables screenshots on error. Set true to not capture Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "distributed_tracing": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Adds distributed tracing headers to API requests using B3 and W3C standards. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "dns_override": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "IP address to use for DNS override. This endpoint never reports the value back (local " + + "acceptance run, 2026-08-03); state carries the configured value.", + }, + "download_limit": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Specifies maximum number of bytes to download from the target object. This endpoint never " + + "reports the value back (local acceptance run, 2026-08-03); state carries the configured " + + "value.", + }, + "emulated_device_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "ID of the emulated device, if specified when the test was created. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted.", + }, + "enabled": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Test is enabled. Computed as well as optional: the 2026-08-03 dispatched acceptance run " + + "(#12) observed the API applying its own value when this is omitted. " + + "The SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "fixed_packet_rate": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Sets packets rate sent to measure the network in packets per second. This endpoint never " + + "reports the value back (local acceptance run, 2026-08-03); state carries the configured " + + "value. The SDK's encoding drops this type's zero value (omitempty), " + + "so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(0, 100), + }, + }, + "follow_redirects": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "To disable following HTTP/301 or HTTP/302 redirect directives, set this parameter to " + + "`false`. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) " + + "observed the API applying its own value when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "http_target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target time for HTTP server completion, specified in milliseconds. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(100, 5000), + }, + }, + "http_time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP time limit in seconds. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(5, 60), + }, + }, + "http_version": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "HTTP protocol version. Set to '2' to prefer HTTP/2, or '1' to use only HTTP/1.1. Computed " + + "as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API " + + "applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 2), + }, + }, + "identify_agent_traffic_with_user_agent": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Determines how agent traffic is identified: * `false`: Adds the `x-thousandeyes-agent: " + + "yes` header. * `true`: Appends `(ThousandEyes Agent)` to the `user-agent` header. For more " + + "information, see [Notes on Agent ID " + + "Strategy](https://docs.thousandeyes.com/product-documentation/browser-synthetics/test-settings-page-load-transaction#notes-on-agent-id-strategy). " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "include_headers": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to `true` to capture response headers for objects loaded by the test. Computed as well " + + "as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its " + + "own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "interval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Interval between test runs in seconds. Documented intervals, in seconds: `60`, `120`, " + + "`300`, `600`, `900`, `1800`, `3600`. The request carries this field unconditionally, so " + + "omitting it sends zero, which the API refuses (the 2026-08-03 scheduled acceptance run).", + }, + "live_share": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is shared with the account group.", + }, + "modified_by": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "User that modified the test.", + }, + "modified_date": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "UTC last modification date (ISO date-time format).", + }, + "mtu_measurements": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set `true` to measure MTU sizes on network from agents to the target. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "network_measurements": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Enable or disable network measurements. Set to true to enable or false to disable network " + + "measurements. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) " + + "observed the API applying its own value when this is omitted. Computed only on this " + + "endpoint: browser tests always network-measure, and the SDK's value-typed omitempty bool " + + "cannot express false anyway (local acceptance run, 2026-08-03).", + }, + "num_path_traces": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Number of path traces executed by the agent. Computed as well as optional: the 2026-08-03 " + + "dispatched acceptance run (#12) observed the API applying its own value when this is " + + "omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(1, 10), + }, + }, + "override_agent_proxy": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Flag indicating if a proxy other than the default should be used. To override the default " + + "proxy for agents, set to `true` and specify a value for `overrideProxyId`. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "override_proxy_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "ID of the proxy to be used if the default proxy is overridden. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "page_loading_strategy": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "* `normal`: The test waits until the entire page is fully loaded, including the " + + "downloading and parsing of HTML content as well as all associated resources, before " + + "advancing to the next action in the transaction test script. * `eager`: The test waits for " + + "the DOMContentLoaded event, indicating that HTML content is downloaded and parsed, and the " + + "document reaches the \"interactive\" readiness state, before proceeding to the next action " + + "in the test script. * `none`: The test only waits for the download of HTML content. Once " + + "the HTML is downloaded, the test continues to the next action in the transaction test " + + "script without waiting for additional resources. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("normal", "eager", "none"), + }, + }, + "password": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Password for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "path_trace_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Select `inSession` to perform the path trace within a TCP session. Computed as well as " + + "optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own " + + "value when this is omitted. The SDK's encoding drops this type's " + + "zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("classic", "in-session"), + }, + }, + "probe_mode": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Probe mode used by network test, only valid when the protocol is set to TCP. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + Validators: []validator.String{ + stringvalidator.OneOf("auto", "sack", "syn"), + }, + }, + "protocol": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Protocol used by dependent network tests (end-to-end, path trace, PMTUD). The specification documents `udp`, which the API " + + "rejected. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + // The API refused "udp" from the documented set when probed. Still permitted here: a value one + // tenant rejects may be licence-gated rather than nonexistent. + Validators: []validator.String{ + stringvalidator.OneOf("tcp", "icmp", "udp"), + }, + }, + "randomized_start_time": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicates whether agents should randomize the start time in each test round. Computed as " + + "well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API applying " + + "its own value when this is omitted. The SDK's encoding drops this " + + "type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. " + + "", + }, + "saved_event": schema.BoolAttribute{ + Computed: true, + MarkdownDescription: "Indicates if the test is a saved event. **Note**: **Saved Events** are now called " + + "**Private Snapshots** in the user interface. This change does not affect API.", + }, + "ssl_version": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Reflects the verbose SSL protocol version used by a test.", + }, + "ssl_version_id": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "SSL version options: * Use '0' for automatic selection. * Use '3' for SSLv3. * Use '4' for " + + "TLS v1.0. * Use '5' for TLS v1.1. * Use '6' for TLS v1.2. * Use '7' for TLS v1.3. Computed " + + "as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the API " + + "applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + Validators: []validator.String{ + stringvalidator.OneOf("0", "3", "4", "5", "6", "7"), + }, + }, + "subinterval": schema.Int64Attribute{ + Optional: true, + MarkdownDescription: "Subinterval for round-robin testing (in seconds). Must be less than or equal to interval " + + "and must evenly divide interval. Documented values: `60`, `120`, `300`, `600`, `900`, " + + "`1200`, `1800`, `3600`. The SDK's encoding drops this type's zero " + + "value (omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + }, + "target_time": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Target completion time, in seconds. Defaults to 10. Cannot exceed the `timeLimit` value. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted.", + Validators: []validator.Int64{ + int64validator.Between(1, 180), + }, + }, + "id": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "Each test is assigned an unique ID; this is used to access test information and results " + + "from other endpoints.", + PlanModifiers: []planmodifier.String{ + stringplanmodifier.UseStateForUnknown(), + }, + }, + "test_name": schema.StringAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "The name of the test. Test name must be unique. Computed as well as optional: the " + + "2026-08-03 dispatched acceptance run (#12) observed the API applying its own value when " + + "this is omitted.", + }, + "time_limit": schema.Int64Attribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Time limit for transaction in seconds. Computed as well as optional: the 2026-08-03 " + + "dispatched acceptance run (#12) observed the API applying its own value when this is " + + "omitted. The SDK's encoding drops this type's zero value " + + "(omitempty), so configuring false, 0 or \"\" silently becomes an omission. ", + Validators: []validator.Int64{ + int64validator.Between(5, 180), + }, + }, + "transaction_script": schema.StringAttribute{ + Required: true, + MarkdownDescription: "JavaScript of a web transaction test. Quotes must be escaped (precede \" characters with \\ " + + ").", + }, + "type": schema.StringAttribute{ + Computed: true, + MarkdownDescription: "This is a read only value, as test type is implicit in the test creation url.", + }, + "url": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Target for the test. The test's target: the API refuses a create without it, whatever the " + + "specification marks.", + }, + "use_ntlm": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Set to true to use NTLM, false to use Basic Authentication. Requires username and password " + + "to be set. Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) " + + "observed the API applying its own value when this is omitted. The " + + "SDK's encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" " + + "silently becomes an omission. ", + }, + "use_public_bgp": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Indicate if all available public BGP monitors should be used, when omitted defaults to " + + "`bgpMeasurements` value. Computed as well as optional: the 2026-08-03 dispatched " + + "acceptance run (#12) observed the API applying its own value when this is omitted. The SDK's encoding drops this type's zero value (omitempty), so " + + "configuring false, 0 or \"\" silently becomes an omission. ", + }, + "user_agent": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "User-agent string to be provided during the test. The SDK's " + + "encoding drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently " + + "becomes an omission. ", + }, + "username": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "Username for Basic/NTLM authentication. The SDK's encoding drops " + + "this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes an " + + "omission. ", + }, + "vault_credentials": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "secret_id": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "UUID of the configured secret.", + }, + "target": schema.StringAttribute{ + Optional: true, + MarkdownDescription: "The target setting that the credential should be used for.", + Validators: []validator.String{ + stringvalidator.OneOf("username", "password", "script"), + }, + }, + }, + }, + Optional: true, + Computed: true, + MarkdownDescription: "List of credential IDs that are stored in an external vault. Computed as well as optional: " + + "the 2026-08-03 dispatched acceptance run (#12) observed the API applying its own value " + + "when this is omitted.", + }, + "verify_certificate": schema.BoolAttribute{ + Optional: true, + Computed: true, + MarkdownDescription: "Ignore or acknowledge certificate errors. Set to false to ignore certificate errors. " + + "Computed as well as optional: the 2026-08-03 dispatched acceptance run (#12) observed the " + + "API applying its own value when this is omitted. The SDK's encoding " + + "drops this type's zero value (omitempty), so configuring false, 0 or \"\" silently becomes " + + "an omission. ", + }, + "agents": schema.SetNestedAttribute{ + NestedObject: schema.NestedAttributeObject{ + Attributes: map[string]schema.Attribute{ + "agent_id": schema.StringAttribute{ + Required: true, + MarkdownDescription: "The agent to run the test from. Get identifiers from `/agents`; cloud agent identifiers " + + "are stable public values.", + }, + }, + }, + Required: true, + MarkdownDescription: "The agents the test runs from. Sent on create and update; the read reports assignment " + + "through its own fields, so this does not round-trip into state.", + }, + }, + Blocks: map[string]schema.Block{ + "timeouts": commonschema.ResourceTimeouts(ctx), + }, + } +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource_acceptance_test.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource_acceptance_test.go new file mode 100644 index 00000000..1c6b6c18 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/resource_acceptance_test.go @@ -0,0 +1,143 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction_test + +import ( + "os" + "path/filepath" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-testing/helper/resource" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/check" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/destroy" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction" +) + +// The resource under test, and the helper that asks the API whether it is really there. +const address = "thousandeyes_tests_web_transaction.test" + +var testResource = tests_web_transaction.TestsWebTransactionTestResource{} + +// TestAccResourceTestsWebTransaction_01_Lifecycle exercises the whole lifecycle against a live API. +// +// Guarded by TF_ACC, which terraform-plugin-testing requires, so `go test ./...` never reaches a +// live tenant by accident. The credential comes from the environment; see internal/acceptance. +// +// Every step ends with an implicit plan, and terraform-plugin-testing fails the step if that plan +// is not empty. That is the single strongest signal available that state mapping is right: an +// attribute the provider stores differently from how the API reports it shows up here as a diff on +// a resource nobody touched, and no amount of compiling or schema checking can see it. +func TestAccResourceTestsWebTransaction_01_Lifecycle(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + ProtoV6ProviderFactories: acceptance.ProtoV6ProviderFactories, + // Destroy is verified against the API rather than against state, because Terraform + // considers a destroy done when the provider's Delete returns no error -- which is a + // statement about the request, not about the object. + // + // The wait is the built-in default; this API's consistency after delete was never measured, + // so this is a budget rather than an observation + CheckDestroy: destroy.CheckDestroyed(testResource, "thousandeyes_tests_web_transaction", 20*time.Second), + Steps: []resource.TestStep{ + // Create, from the smallest configuration the schema permits. + { + Config: config(t, "minimal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("interval").Exists(), + check.That(address).Key("transaction_script").HasValue("tfacc-transaction-script"), + check.That(address).Key("url").Exists(), + ), + }, + // Import, then compare every attribute against the state the apply produced. + // + // This is what catches a read that populates state differently from a create, which + // is the most common way a generated provider is subtly wrong. + { + ResourceName: address, + ImportState: true, + ImportStateVerify: true, + // Skipped, with the reason for each. An attribute the API never returns is + // absent after an import and present before it, so comparing it fails for a + // reason that has nothing to do with import being broken. + // dns_override: it is write-only, carried from configuration, which an import does not have + // download_limit: it is write-only, carried from configuration, which an import does not have + // fixed_packet_rate: it is write-only, carried from configuration, which an import does not + // have + // agents: it is write-only, carried from configuration, which an import does not have + ImportStateVerifyIgnore: []string{"dns_override", "download_limit", "fixed_packet_rate", "agents"}, + }, + // Update in place, to a configuration that sets the optional attributes too. + { + Config: config(t, "maximal.tf"), + Check: resource.ComposeAggregateTestCheckFunc( + check.That(address).ExistsInAPI(testResource), + check.That(address).Key("id").Exists(), + check.That(address).Key("alerts_enabled").HasValue("true"), + check.That(address).Key("allow_geolocation").HasValue("true"), + check.That(address).Key("allow_mic_and_camera").HasValue("true"), + check.That(address).Key("allow_unsafe_legacy_renegotiation").HasValue("true"), + check.That(address).Key("auth_type").HasValue("none"), + check.That(address).Key("bandwidth_measurements").Exists(), + check.That(address).Key("bgp_measurements").HasValue("true"), + check.That(address).Key("block_domains").HasValue("tfacc-block-domains"), + check.That(address).Key("browser_language").Exists(), + check.That(address).Key("chrome_options").Exists(), + check.That(address).Key("collect_proxy_network_data").Exists(), + check.That(address).Key("content_regex").HasValue("tfacc-content-regex"), + check.That(address).Key("description").HasValue("tfacc-description"), + check.That(address).Key("desired_status_code").Exists(), + check.That(address).Key("disable_screenshot").HasValue("true"), + check.That(address).Key("distributed_tracing").HasValue("true"), + check.That(address).Key("enabled").HasValue("true"), + check.That(address).Key("follow_redirects").HasValue("true"), + check.That(address).Key("http_target_time").HasValue("100"), + check.That(address).Key("http_time_limit").HasValue("5"), + check.That(address).Key("http_version").HasValue("1"), + check.That(address).Key("identify_agent_traffic_with_user_agent").HasValue("true"), + check.That(address).Key("include_headers").HasValue("true"), + check.That(address).Key("interval").Exists(), + check.That(address).Key("mtu_measurements").HasValue("true"), + check.That(address).Key("num_path_traces").Exists(), + check.That(address).Key("override_agent_proxy").HasValue("true"), + check.That(address).Key("page_loading_strategy").HasValue("normal"), + check.That(address).Key("path_trace_mode").HasValue("classic"), + check.That(address).Key("probe_mode").HasValue("auto"), + check.That(address).Key("protocol").HasValue("tcp"), + check.That(address).Key("randomized_start_time").Exists(), + check.That(address).Key("ssl_version_id").HasValue("0"), + check.That(address).Key("subinterval").HasValue("60"), + check.That(address).Key("target_time").HasValue("1"), + check.That(address).Key("test_name").HasValue("tfacc-test-name"), + check.That(address).Key("time_limit").HasValue("5"), + check.That(address).Key("transaction_script").HasValue("tfacc-transaction-script"), + check.That(address).Key("url").Exists(), + check.That(address).Key("use_ntlm").Exists(), + check.That(address).Key("use_public_bgp").HasValue("true"), + check.That(address).Key("user_agent").Exists(), + check.That(address).Key("verify_certificate").HasValue("true"), + ), + }, + }, + }) +} + +// config reads one of the committed fixtures. +// +// From testdata rather than from a string constant in this file, so the configuration can be +// edited and re-run without recompiling, and so `terraform fmt` can police it. +func config(t *testing.T, name string) string { + t.Helper() + + body, err := os.ReadFile(filepath.Join("testdata", name)) + if err != nil { + t.Fatalf("reading fixture %s: %v", name, err) + } + + return string(body) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/state.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/state.go new file mode 100644 index 00000000..2e9cd13f --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/state.go @@ -0,0 +1,126 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-framework/diag" + "github.com/hashicorp/terraform-plugin-framework/types" + "github.com/hashicorp/terraform-plugin-log/tflog" + + models "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk/models" + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/services/common/convert" +) + +// mapRemoteStateToTerraform maps the API's response onto Terraform state. +// +// This function replaces what a reflection-based provider does at runtime. Being +// generated code, a field whose conversion is wrong is a compile error rather +// than a surprise during apply. +func mapRemoteStateToTerraform(ctx context.Context, data *TestsWebTransactionResourceModel, remote models.Tests_API_WebTransactionTestResponseable) diag.Diagnostics { + var ( + diags diag.Diagnostics + d diag.Diagnostics + ) + + if remote == nil { + tflog.Debug(ctx, "remote resource is nil, leaving state untouched", map[string]any{ + "resource": TypeName, + }) + return diags + } + + data.AlertsEnabled = convert.PtrBoolToFramework(remote.GetAlertsEnabled()) + data.AllowGeolocation = convert.PtrBoolToFramework(remote.GetAllowGeolocation()) + data.AllowMicAndCamera = convert.PtrBoolToFramework(remote.GetAllowMicAndCamera()) + data.AllowUnsafeLegacyRenegotiation = convert.PtrBoolToFramework(remote.GetAllowUnsafeLegacyRenegotiation()) + data.AuthType = convert.PtrStringerToFramework(remote.GetAuthType()) + data.BandwidthMeasurements = convert.PtrBoolToFramework(remote.GetBandwidthMeasurements()) + data.BGPMeasurements = convert.PtrBoolToFramework(remote.GetBgpMeasurements()) + data.BlockDomains = convert.PtrStringToFramework(remote.GetBlockDomains()) + data.BrowserLanguage = convert.PtrStringToFramework(remote.GetBrowserLanguage()) + data.ChromeOptions = convert.PtrStringToFramework(remote.GetChromeOptions()) + data.ClientCertificate = convert.PtrStringToFramework(remote.GetClientCertificate()) + data.CollectProxyNetworkData = convert.PtrBoolToFramework(remote.GetCollectProxyNetworkData()) + data.ContentRegex = convert.PtrStringToFramework(remote.GetContentRegex()) + data.CreatedBy = convert.PtrStringToFramework(remote.GetCreatedBy()) + data.CreatedDate = convert.PtrTimeToFramework(remote.GetCreatedDate()) + data.Credentials, d = convert.StringSliceToFrameworkSet(ctx, remote.GetCredentials()) + diags.Append(d...) + data.Description = convert.PtrStringToFramework(remote.GetDescription()) + data.DesiredStatusCode = convert.PtrStringToFramework(remote.GetDesiredStatusCode()) + data.DisableScreenshot = convert.PtrBoolToFramework(remote.GetDisableScreenshot()) + data.DistributedTracing = convert.PtrBoolToFramework(remote.GetDistributedTracing()) + data.EmulatedDeviceID = convert.PtrStringToFramework(remote.GetEmulatedDeviceId()) + data.Enabled = convert.PtrBoolToFramework(remote.GetEnabled()) + data.FollowRedirects = convert.PtrBoolToFramework(remote.GetFollowRedirects()) + data.HTTPTargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTargetTime()) + data.HTTPTimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetHttpTimeLimit()) + data.HTTPVersion = convert.PtrInt32ToFrameworkInt64(remote.GetHttpVersion()) + data.IdentifyAgentTrafficWithUserAgent = convert.PtrBoolToFramework(remote.GetIdentifyAgentTrafficWithUserAgent()) + data.IncludeHeaders = convert.PtrBoolToFramework(remote.GetIncludeHeaders()) + data.Interval = convert.PtrInt32ToFrameworkInt64(remote.GetInterval()) + data.LiveShare = convert.PtrBoolToFramework(remote.GetLiveShare()) + data.ModifiedBy = convert.PtrStringToFramework(remote.GetModifiedBy()) + data.ModifiedDate = convert.PtrTimeToFramework(remote.GetModifiedDate()) + data.MTUMeasurements = convert.PtrBoolToFramework(remote.GetMtuMeasurements()) + data.NetworkMeasurements = convert.PtrBoolToFramework(remote.GetNetworkMeasurements()) + data.NumPathTraces = convert.PtrInt32ToFrameworkInt64(remote.GetNumPathTraces()) + data.OverrideAgentProxy = convert.PtrBoolToFramework(remote.GetOverrideAgentProxy()) + data.OverrideProxyID = convert.PtrStringToFramework(remote.GetOverrideProxyId()) + data.PageLoadingStrategy = convert.PtrStringerToFramework(remote.GetPageLoadingStrategy()) + data.Password = convert.PtrStringToFramework(remote.GetPassword()) + data.PathTraceMode = convert.PtrStringerToFramework(remote.GetPathTraceMode()) + data.ProbeMode = convert.PtrStringerToFramework(remote.GetProbeMode()) + data.Protocol = convert.PtrStringerToFramework(remote.GetProtocol()) + data.RandomizedStartTime = convert.PtrBoolToFramework(remote.GetRandomizedStartTime()) + data.SavedEvent = convert.PtrBoolToFramework(remote.GetSavedEvent()) + data.SSLVersion = convert.PtrStringToFramework(remote.GetSslVersion()) + data.SSLVersionID = convert.PtrStringerToFramework(remote.GetSslVersionId()) + data.Subinterval = convert.PtrInt32ToFrameworkInt64(remote.GetSubinterval()) + data.TargetTime = convert.PtrInt32ToFrameworkInt64(remote.GetTargetTime()) + data.ID = convert.PtrStringToFramework(remote.GetTestId()) + data.TestName = convert.PtrStringToFramework(remote.GetTestName()) + data.TimeLimit = convert.PtrInt32ToFrameworkInt64(remote.GetTimeLimit()) + data.TransactionScript = convert.PtrStringToFramework(remote.GetTransactionScript()) + data.Type = convert.PtrStringerToFramework(remote.GetTypeEscaped()) + data.URL = convert.PtrStringToFramework(remote.GetUrl()) + data.UseNtlm = convert.PtrBoolToFramework(remote.GetUseNtlm()) + data.UsePublicBGP = convert.PtrBoolToFramework(remote.GetUsePublicBgp()) + data.UserAgent = convert.PtrStringToFramework(remote.GetUserAgent()) + data.Username = convert.PtrStringToFramework(remote.GetUsername()) + data.VaultCredentials, d = flattenTestsWebTransactionTestVaultCredentials(ctx, remote.GetVaultCredentials()) + diags.Append(d...) + data.VerifyCertificate = convert.PtrBoolToFramework(remote.GetVerifyCertificate()) + + tflog.Debug(ctx, "mapped remote state", map[string]any{"resource": TypeName}) + + return diags +} + +// flattenTestsWebTransactionTestVaultCredentials converts SDK structs into the framework value state holds. +func flattenTestsWebTransactionTestVaultCredentials(ctx context.Context, in []models.Tests_API_TestVaultCredentialable) (types.Set, diag.Diagnostics) { + var diags diag.Diagnostics + + // A nil slice is null and an empty slice is empty. Conflating them produces a + // diff no configuration change can resolve. + if in == nil { + return types.SetNull(testsWebTransactionTestVaultCredentialObjectType), diags + } + + elements := make([]TestsWebTransactionTestVaultCredentialModel, 0, len(in)) + for _, item := range in { + var m TestsWebTransactionTestVaultCredentialModel + + m.SecretID = convert.PtrStringToFramework(item.GetSecretId()) + m.Target = convert.PtrStringerToFramework(item.GetTarget()) + elements = append(elements, m) + } + + out, d2 := types.SetValueFrom(ctx, testsWebTransactionTestVaultCredentialObjectType, elements) + diags.Append(d2...) + + return out, diags +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/test_helper_test.go b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/test_helper_test.go new file mode 100644 index 00000000..29479a7a --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/test_helper_test.go @@ -0,0 +1,40 @@ +// Code generated by tfpfgen from blueprints/thousandeyes-kiota +// (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +package tests_web_transaction + +import ( + "context" + + "github.com/hashicorp/terraform-plugin-testing/terraform" + + "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/acceptance/exists" + sdk "github.com/deploymenttheory/terraform-plugin-framework-codegen/pilot/thousandeyes-kiota/internal/sdk" +) + +// TestsWebTransactionTestResource answers whether a thousandeyes_tests_web_transaction is really in the API. +// +// In a _test.go file rather than an ordinary one, so no test scaffolding reaches a built +// provider. An external _test package still sees the exported identifiers of a package's own +// test files, which is what lets the generated acceptance test refer to this. +type TestsWebTransactionTestResource struct{} + +// Exists reads the object back through the same operation the resource's Read uses. +// +// Deliberately the same call rather than an equivalent one. A check that asked a list endpoint +// instead could report an object present while the read the provider actually depends on was +// broken, which is the failure an acceptance test exists to catch. +func (TestsWebTransactionTestResource) Exists( + ctx context.Context, + state *terraform.InstanceState, +) (*bool, error) { + return exists.Check(ctx, state, func( + ctx context.Context, + client *sdk.ThousandEyesClient, + state *terraform.InstanceState, + ) error { + _, err := client.Tests().WebTransactions().ByTestId(state.ID).Get(ctx, nil) + + return err + }) +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/maximal.tf b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/maximal.tf new file mode 100644 index 00000000..dd892eaa --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/maximal.tf @@ -0,0 +1,131 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The widest configuration the evidence supports: every writable attribute with a derivable +# value, chosen by the same derivation the rehearsal probe sends to the live API. +# +# Regenerated and policed, deliberately. This file used to be a hand-owned scaffold, and +# hand edits are how its values drifted from the generated assertions -- the checks derive +# from the blueprint, so the blueprint is where a value is corrected: an accFixture hint for +# something only a human knows, recorded behaviour for everything the probe observed. What +# could not be derived is listed inside the block, each with the reason. + +resource "thousandeyes_tests_web_transaction" "test" { + # Where a value came from. + # + # auth_type: documented; unprobed + # + # bandwidth_measurements: curated in the blueprint's accFixture; the generator cannot derive + # it + # + # browser_language: curated in the blueprint's accFixture; the generator cannot derive it + # + # chrome_options: curated in the blueprint's accFixture; the generator cannot derive it + # + # collect_proxy_network_data: curated in the blueprint's accFixture; the generator cannot + # derive it + # + # desired_status_code: curated in the blueprint's accFixture; the generator cannot derive it + # + # dns_override: curated in the blueprint's accFixture; the generator cannot derive it + # + # fixed_packet_rate: curated in the blueprint's accFixture; the generator cannot derive it + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # num_path_traces: curated in the blueprint's accFixture; the generator cannot derive it + # + # page_loading_strategy: documented; unprobed + # + # path_trace_mode: documented; unprobed + # + # probe_mode: documented; unprobed + # + # protocol: documented; unprobed + # + # randomized_start_time: curated in the blueprint's accFixture; the generator cannot derive it + # + # ssl_version_id: documented; unprobed + # + # subinterval: documented; unprobed + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # use_ntlm: curated in the blueprint's accFixture; the generator cannot derive it + # + # user_agent: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + # + # Not filled in, because no correct value could be derived. Each of these is optional, so this + # configuration is valid as it stands -- but it is testing less than it could. + # + # client_certificate: it is credential-shaped, and a generated fixture must not invent values + # that read as secrets; supply one through accFixture if the test needs it + # + # credentials: its elements have no derivable value: it is credential-shaped, and a generated + # fixture must not invent values that read as secrets; supply one through accFixture if the + # test needs it + # + # emulated_device_id: it references an object that must already exist, which a synthesised + # value cannot name; supply one through accFixture if the test has the object + # + # override_proxy_id: it references an object that must already exist, which a synthesised + # value cannot name; supply one through accFixture if the test has the object + # + # password: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # username: it is credential-shaped, and a generated fixture must not invent values that read + # as secrets; supply one through accFixture if the test needs it + # + # vault_credentials: a nested object's members may be identifiers of objects that must already + # exist, and nothing in the specification says whether they are + alerts_enabled = true + allow_geolocation = true + allow_mic_and_camera = true + allow_unsafe_legacy_renegotiation = true + auth_type = "none" + bandwidth_measurements = false + bgp_measurements = true + block_domains = "tfacc-block-domains" + browser_language = "en-US" + chrome_options = "--disable-gpu" + collect_proxy_network_data = false + content_regex = "tfacc-content-regex" + description = "tfacc-description" + desired_status_code = "200" + disable_screenshot = true + distributed_tracing = true + dns_override = "8.8.8.8" + download_limit = 1 + enabled = true + fixed_packet_rate = 50 + follow_redirects = true + http_target_time = 100 + http_time_limit = 5 + http_version = 1 + identify_agent_traffic_with_user_agent = true + include_headers = true + interval = 3600 + mtu_measurements = true + num_path_traces = 3 + override_agent_proxy = true + page_loading_strategy = "normal" + path_trace_mode = "classic" + probe_mode = "auto" + protocol = "tcp" + randomized_start_time = false + ssl_version_id = "0" + subinterval = "60" + target_time = 1 + test_name = "tfacc-test-name" + time_limit = 5 + transaction_script = "tfacc-transaction-script" + url = "https://www.example.com" + use_ntlm = false + use_public_bgp = true + user_agent = "tfacc (ThousandEyes Agent)" + verify_certificate = true + agents = [{ agent_id = "3" }] +} diff --git a/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/minimal.tf b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/minimal.tf new file mode 100644 index 00000000..0b4d6ea0 --- /dev/null +++ b/pilot/thousandeyes-kiota/internal/services/resources/web_transaction_tests/v7/tests_web_transaction/testdata/minimal.tf @@ -0,0 +1,25 @@ +# Code generated by tfpfgen from blueprints/thousandeyes-kiota +# (sha256:e482f622067c5bc4fbc532aaa23f55409f3e80bf1658dd19e5facd54a6f0fe37). DO NOT EDIT. + +# The smallest configuration this resource accepts: its required attributes and nothing else. +# +# Regenerated, so it follows the schema. If the API starts requiring a field, this file gains it +# on the next emit rather than an acceptance run discovering it. + +resource "thousandeyes_tests_web_transaction" "test" { + # Where a value came from. A fixture takes what the API was observed to accept, not the first + # value the specification documents -- which is the opposite of how a generated validator is + # built. A validator errs toward permitting, because blocking a configuration the API would + # have taken is a harm nobody can work around; a fixture errs toward working, because it is an + # input rather than a contract. + # + # interval: curated in the blueprint's accFixture; the generator cannot derive it + # + # url: curated in the blueprint's accFixture; the generator cannot derive it + # + # agents: curated in the blueprint's accFixture; the generator cannot derive it + interval = 3600 + transaction_script = "tfacc-transaction-script" + url = "https://www.example.com" + agents = [{ agent_id = "3" }] +}