diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f9610113951..37b23f3961d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -71370,10 +71370,6 @@ components: $ref: "#/components/schemas/SyntheticsApiMultistepSubtestData" type: array type: object - SyntheticsFastTestAssertionResult: - additionalProperties: {} - description: Result of a single assertion evaluated during a fast test run. - type: object SyntheticsFastTestResult: description: |- Fast test result response. Returns `null` if the result is not yet available @@ -71387,19 +71383,18 @@ components: description: Attributes of the fast test result. properties: device: - $ref: "#/components/schemas/SyntheticsFastTestResultDevice" + $ref: "#/components/schemas/SyntheticsTestResultDevice" location: - $ref: "#/components/schemas/SyntheticsFastTestResultLocation" + $ref: "#/components/schemas/SyntheticsTestResultLocation" result: $ref: "#/components/schemas/SyntheticsFastTestResultDetail" test_sub_type: $ref: "#/components/schemas/SyntheticsFastTestSubType" test_type: - description: The type of the Synthetic test that produced this result (for example, `api` or `browser`). - example: api - type: string + $ref: "#/components/schemas/SyntheticsFastTestType" test_version: description: Version of the test at the time the fast test was triggered. + example: 1 format: int64 type: integer type: object @@ -71423,48 +71418,47 @@ components: assertions: description: Results of each assertion evaluated during the test. items: - $ref: "#/components/schemas/SyntheticsFastTestAssertionResult" + $ref: "#/components/schemas/SyntheticsTestResultAssertionResult" type: array call_type: description: gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + example: unary type: string cert: - additionalProperties: {} - description: TLS certificate details, present for SSL tests. - type: object + $ref: "#/components/schemas/SyntheticsTestResultCertificate" duration: description: Total duration of the test in milliseconds. + example: 150.5 format: double type: number failure: - $ref: "#/components/schemas/SyntheticsFastTestResultFailure" + $ref: "#/components/schemas/SyntheticsTestResultFailure" finished_at: description: Unix timestamp (ms) of when the test finished. + example: 1679328001000 format: int64 type: integer id: description: The result ID. Set to the fast test UUID because no persistent result ID exists for fast tests. + example: abc12345-1234-1234-1234-abc123456789 type: string is_fast_retry: description: Whether this result is from an automatic fast retry. + example: false type: boolean request: - additionalProperties: {} - description: Details of the outgoing request made during the test. - type: object + $ref: "#/components/schemas/SyntheticsTestResultRequestInfo" resolved_ip: description: IP address resolved for the target host. example: "1.2.3.4" type: string response: - additionalProperties: {} - description: Details of the response received during the test. - type: object + $ref: "#/components/schemas/SyntheticsTestResultResponseInfo" run_type: - description: Run type indicating how this test was triggered (for example, `fast`). - type: string + $ref: "#/components/schemas/SyntheticsTestResultRunType" started_at: description: Unix timestamp (ms) of when the test started. + example: 1679328000000 format: int64 type: integer status: @@ -71474,67 +71468,34 @@ components: steps: description: Step results for multistep API tests. items: - $ref: "#/components/schemas/SyntheticsFastTestStepResult" + $ref: "#/components/schemas/SyntheticsTestResultStep" type: array timings: additionalProperties: {} description: Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). + example: + dns: 2.9 + download: 2.1 + firstByte: 95.2 + ssl: 187.9 + tcp: 92.6 + total: 380.7 type: object traceroute: description: Traceroute hop results, present for ICMP and TCP tests. items: - $ref: "#/components/schemas/SyntheticsFastTestTracerouteHop" + $ref: "#/components/schemas/SyntheticsTestResultTracerouteHop" type: array triggered_at: description: Unix timestamp (ms) of when the test was triggered. + example: 1679327999000 format: int64 type: integer tunnel: description: Whether the test was run through a Synthetics tunnel. + example: false type: boolean type: object - SyntheticsFastTestResultDevice: - description: Device information for browser-based fast tests. - properties: - id: - description: Device identifier. - example: chrome.laptop_large - type: string - name: - description: Display name of the device. - example: Laptop Large - type: string - type: object - SyntheticsFastTestResultFailure: - description: Failure details if the fast test did not pass. - properties: - code: - description: Error code identifying the failure type. - example: TIMEOUT - type: string - message: - description: Human-readable description of the failure. - example: Connection timed out - type: string - type: object - SyntheticsFastTestResultLocation: - description: Location from which the fast test was executed. - properties: - id: - description: ID of the location. - example: aws:us-east-1 - type: string - name: - description: Display name of the location. - example: N. Virginia (AWS) - type: string - version: - description: Agent version running at this location. - type: string - worker_id: - description: Identifier of the specific worker that ran the test. - type: string - type: object SyntheticsFastTestResultType: default: result description: JSON:API type for a fast test result. @@ -71544,10 +71505,6 @@ components: type: string x-enum-varnames: - RESULT - SyntheticsFastTestStepResult: - additionalProperties: {} - description: Result of a single step in a multistep fast test run. - type: object SyntheticsFastTestSubType: description: Subtype of the Synthetic test that produced this result. enum: @@ -71574,10 +71531,16 @@ components: - TCP - UDP - WEBSOCKET - SyntheticsFastTestTracerouteHop: - additionalProperties: {} - description: A single traceroute hop result from a fast test run. - type: object + SyntheticsFastTestType: + description: Type of the Synthetic fast test that produced this result. + enum: + - fast-api + - fast-browser + example: fast-api + type: string + x-enum-varnames: + - FAST_API + - FAST_BROWSER SyntheticsGlobalVariable: description: Synthetic global variable. properties: @@ -72062,6 +72025,20 @@ components: type: string x-enum-varnames: - NETWORK + SyntheticsPollTestResultsResponse: + description: Response object for polling Synthetic test results. + properties: + data: + description: Array of Synthetic test results. + items: + $ref: "#/components/schemas/SyntheticsTestResultData" + type: array + included: + description: Array of included related resources, such as the test definition. + items: + $ref: "#/components/schemas/SyntheticsTestResultIncludedItem" + type: array + type: object SyntheticsRestrictedRoles: deprecated: true description: A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. This field is deprecated. Use the restriction policies API to manage permissions. @@ -72359,6 +72336,20 @@ components: multipart_presigned_urls_params: $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsParams" type: object + SyntheticsTestLatestResultsResponse: + description: Response object for a Synthetic test's latest result summaries. + properties: + data: + description: Array of Synthetic test result summaries. + items: + $ref: "#/components/schemas/SyntheticsTestResultSummaryData" + type: array + included: + description: Array of included related resources, such as the test definition. + items: + $ref: "#/components/schemas/SyntheticsTestResultIncludedItem" + type: array + type: object SyntheticsTestOptions: description: Object describing the extra options for a Synthetic test. properties: @@ -72569,6 +72560,1910 @@ components: x-enum-varnames: - LIVE - PAUSED + SyntheticsTestResultAssertionResult: + description: An individual assertion result from a Synthetic test. + properties: + actual: + description: Actual value observed during the test. Its type depends on the assertion type. + example: 200 + error_message: + description: Error message if the assertion failed. + example: "Assertion failed: expected 200 but got 500" + type: string + expected: + description: Expected value for the assertion. Its type depends on the assertion type. + example: "200" + operator: + description: Operator used for the assertion (for example, `is`, `contains`). + example: is + type: string + property: + description: Property targeted by the assertion, when applicable. + example: content-type + type: string + target: + description: Target value for the assertion. Its type depends on the assertion type. + example: 200 + target_path: + description: JSON path or XPath evaluated for the assertion. + example: $.url + type: string + target_path_operator: + description: Operator used for the target path assertion. + example: contains + type: string + type: + description: Type of the assertion (for example, `responseTime`, `statusCode`, `body`). + example: statusCode + type: string + valid: + description: Whether the assertion passed. + example: true + type: boolean + type: object + SyntheticsTestResultAttributes: + description: Attributes of a Synthetic test result. + properties: + batch: + $ref: "#/components/schemas/SyntheticsTestResultBatch" + ci: + $ref: "#/components/schemas/SyntheticsTestResultCI" + device: + $ref: "#/components/schemas/SyntheticsTestResultDevice" + git: + $ref: "#/components/schemas/SyntheticsTestResultGit" + location: + $ref: "#/components/schemas/SyntheticsTestResultLocation" + result: + $ref: "#/components/schemas/SyntheticsTestResultDetail" + test_sub_type: + $ref: "#/components/schemas/SyntheticsTestSubType" + test_type: + $ref: "#/components/schemas/SyntheticsTestType" + type: object + SyntheticsTestResultBatch: + description: Batch information for the test result. + properties: + id: + description: Batch identifier. + example: batch-abc-123 + type: string + type: object + SyntheticsTestResultBounds: + description: Bounding box of an element on the page. + properties: + height: + description: Height in pixels. + example: 37 + format: int64 + type: integer + width: + description: Width in pixels. + example: 343 + format: int64 + type: integer + x: + description: Horizontal position in pixels. + example: 16 + format: int64 + type: integer + y: + description: Vertical position in pixels. + example: 140 + format: int64 + type: integer + type: object + SyntheticsTestResultBrowserError: + description: A browser error captured during a browser test step. + properties: + description: + description: Error description. + example: Failed to fetch resource + type: string + method: + description: HTTP method associated with the error (for network errors). + example: GET + type: string + name: + description: Error name. + example: NetworkError + type: string + status: + description: HTTP status code associated with the error (for network errors). + example: 500 + format: int64 + type: integer + type: + description: Type of the browser error. + example: network + type: string + url: + additionalProperties: {} + description: URL associated with the error. + type: object + type: object + SyntheticsTestResultBucketKeys: + description: Storage bucket keys for artifacts produced during a step or test. + properties: + after_step_screenshot: + description: Key for the screenshot captured after the step (goal-based tests). + example: screenshots/after-step-1-1.png + type: string + after_turn_screenshot: + description: Key for the screenshot captured after the turn (goal-based tests). + example: screenshots/after-turn-1.png + type: string + artifacts: + description: Key for miscellaneous artifacts. + example: 2/e2e-tests/equ-jku-twc/results/6989498452827932222/edge.laptop_large/artifacts__1724521416257.json + type: string + before_step_screenshot: + description: Key for the screenshot captured before the step (goal-based tests). + example: screenshots/before-step-1-1.png + type: string + before_turn_screenshot: + description: Key for the screenshot captured before the turn (goal-based tests). + example: screenshots/before-turn-1.png + type: string + crash_report: + description: Key for a captured crash report. + example: 2/e2e-tests/d2z-32s-iax/results/1340718101990858549/synthetics:mobile:device:iphone_se_2020_ios_14/crash_report.log + type: string + device_logs: + description: Key for captured device logs. + example: 2/e2e-tests/d2z-32s-iax/results/1340718101990858549/synthetics:mobile:device:iphone_se_2020_ios_14/d2z-32s-iax_1340718101990858549_device_logs.log + type: string + email_messages: + description: Keys for email message payloads captured by the step. + items: + description: Storage bucket key for a captured email message. + type: string + type: array + screenshot: + description: Key for the captured screenshot. + example: 2/e2e-tests/equ-jku-twc/results/6989498452827932222/edge.laptop_large/step-0__1724521416269.jpeg + type: string + snapshot: + description: Key for the captured DOM snapshot. + example: 2/e2e-tests/equ-jku-twc/results/6989498452827932222/edge.laptop_large/snapshot.html + type: string + source: + description: Key for the page source or element source. + example: 2/e2e-tests/d2z-32s-iax/results/1340718101990858549/synthetics:mobile:device:iphone_se_2020_ios_14/step-0__1724445301832.xml + type: string + type: object + SyntheticsTestResultCI: + description: CI information associated with the test result. + properties: + pipeline: + $ref: "#/components/schemas/SyntheticsTestResultCIPipeline" + provider: + $ref: "#/components/schemas/SyntheticsTestResultCIProvider" + stage: + $ref: "#/components/schemas/SyntheticsTestResultCIStage" + workspace_path: + description: Path of the workspace that ran the CI job. + example: /home/runner/work/example + type: string + type: object + SyntheticsTestResultCIPipeline: + description: Details of the CI pipeline. + properties: + id: + description: Pipeline identifier. + example: pipeline-abc-123 + type: string + name: + description: Pipeline name. + example: build-and-test + type: string + number: + description: Pipeline number. + example: 42 + format: int64 + type: integer + url: + description: Pipeline URL. + example: https://github.com/DataDog/example/actions/runs/42 + type: string + type: object + SyntheticsTestResultCIProvider: + description: Details of the CI provider. + properties: + name: + description: Provider name. + example: github + type: string + type: object + SyntheticsTestResultCIStage: + description: Details of the CI stage. + properties: + name: + description: Stage name. + example: test + type: string + type: object + SyntheticsTestResultCdnCacheStatus: + description: Cache status reported by the CDN for the response. + properties: + cached: + description: Whether the response was served from the CDN cache. + example: true + type: boolean + status: + description: Raw cache status string reported by the CDN. + example: HIT + type: string + type: object + SyntheticsTestResultCdnProviderInfo: + description: CDN provider details inferred from response headers. + properties: + cache: + $ref: "#/components/schemas/SyntheticsTestResultCdnCacheStatus" + provider: + description: Name of the CDN provider. + example: google_cloud + type: string + type: object + SyntheticsTestResultCdnResource: + description: A CDN resource encountered while executing a browser step. + properties: + cdn: + $ref: "#/components/schemas/SyntheticsTestResultCdnProviderInfo" + resolved_ip: + description: Resolved IP address for the CDN resource. + example: 34.95.79.70 + type: string + timestamp: + description: Unix timestamp (ms) of when the resource was fetched. + example: 1724521406576 + format: int64 + type: integer + timings: + additionalProperties: {} + description: Timing breakdown for fetching the CDN resource. + example: + firstByte: 99.7 + tcp: 0.9 + type: object + type: object + SyntheticsTestResultCertificate: + description: SSL/TLS certificate information returned from an SSL test. + properties: + cipher: + description: Cipher used for the TLS connection. + example: TLS_AES_256_GCM_SHA384 + type: string + exponent: + description: RSA exponent of the certificate. + example: 65537 + format: int64 + type: integer + ext_key_usage: + description: Extended key usage extensions for the certificate. + example: + - 1.3.6.1.5.5.7.3.1 + items: + description: Extended key usage value. + type: string + type: array + fingerprint: + description: SHA-1 fingerprint of the certificate. + example: D6:03:5A:9F:93:E1:B7:28:EC:90:C5:9F:72:30:55:7C:74:5F:53:92 + type: string + fingerprint256: + description: SHA-256 fingerprint of the certificate. + example: 04:45:93:A9:4C:14:70:47:DB:3C:FC:05:F9:5A:50:4E:DA:DB:A1:C6:37:3D:15:C0:B2:7E:5D:93:5F:A2:02:C7 + type: string + issuer: + additionalProperties: + type: string + description: Certificate issuer details. + example: + C: US + CN: WE2 + O: Google Trust Services + type: object + modulus: + description: RSA modulus of the certificate. + example: C0FCE9F9... + type: string + protocol: + description: TLS protocol used (for example, `TLSv1.2`). + example: TLSv1.3 + type: string + serial_number: + description: Serial number of the certificate. + example: 7B584A1A6670A1EB0941A9A121569D60 + type: string + subject: + additionalProperties: + type: string + description: Certificate subject details. + example: + CN: "*.google.fr" + altName: "DNS:*.google.fr, DNS:google.fr" + type: object + tls_version: + description: TLS protocol version. + example: 1.3 + format: double + type: number + valid: + $ref: "#/components/schemas/SyntheticsTestResultCertificateValidity" + type: object + SyntheticsTestResultCertificateValidity: + description: Validity window of a certificate. + properties: + from: + description: Unix timestamp (ms) of when the certificate became valid. + example: 1742469686000 + format: int64 + type: integer + to: + description: Unix timestamp (ms) of when the certificate expires. + example: 1749727285000 + format: int64 + type: integer + type: object + SyntheticsTestResultData: + description: Wrapper object for a Synthetic test result. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestResultAttributes" + id: + description: The result ID. + example: "5158904793181869365" + type: string + relationships: + $ref: "#/components/schemas/SyntheticsTestResultRelationships" + type: + $ref: "#/components/schemas/SyntheticsTestResultType" + type: object + SyntheticsTestResultDetail: + description: Full result details for a Synthetic test execution. + properties: + assertions: + description: Assertion results produced by the test. + items: + $ref: "#/components/schemas/SyntheticsTestResultAssertionResult" + type: array + bucket_keys: + $ref: "#/components/schemas/SyntheticsTestResultBucketKeys" + call_type: + description: gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + example: unary + type: string + cert: + $ref: "#/components/schemas/SyntheticsTestResultCertificate" + compressed_json_descriptor: + description: Compressed JSON descriptor for the test (internal format). + example: compressedJsonDescriptorValue + type: string + compressed_steps: + description: Compressed representation of the test steps (internal format). + example: eJzLSM3JyQcABiwCFQ== + type: string + connection_outcome: + description: Outcome of the connection attempt (for example, `established`, `refused`). + example: established + type: string + dns_resolution: + $ref: "#/components/schemas/SyntheticsTestResultDnsResolution" + duration: + description: Duration of the test execution (in milliseconds). + example: 380.7 + format: double + type: number + exited_on_step_success: + description: Whether the test exited early because a step marked with `exitIfSucceed` passed. + example: false + type: boolean + failure: + $ref: "#/components/schemas/SyntheticsTestResultFailure" + finished_at: + description: Timestamp of when the test finished (in milliseconds). + example: 1723782422760 + format: int64 + type: integer + handshake: + $ref: "#/components/schemas/SyntheticsTestResultHandshake" + id: + description: The unique identifier for this result. + example: "5158904793181869365" + type: string + initial_id: + description: The initial result ID before any retries. + example: "5158904793181869365" + type: string + is_fast_retry: + description: Whether this result is from a fast retry. + example: true + type: boolean + is_last_retry: + description: Whether this result is from the last retry. + example: true + type: boolean + netpath: + $ref: "#/components/schemas/SyntheticsTestResultNetpath" + netstats: + $ref: "#/components/schemas/SyntheticsTestResultNetstats" + ocsp: + $ref: "#/components/schemas/SyntheticsTestResultOCSPResponse" + ping: + $ref: "#/components/schemas/SyntheticsTestResultTracerouteHop" + received_email_count: + description: Number of emails received during the test (email tests). + example: 1 + format: int64 + type: integer + received_message: + description: Message received from the target (for WebSocket/TCP/UDP tests). + example: "UDP echo: b'Test message'" + type: string + request: + $ref: "#/components/schemas/SyntheticsTestResultRequestInfo" + resolved_ip: + description: IP address resolved for the target host. + example: "54.243.255.141" + type: string + response: + $ref: "#/components/schemas/SyntheticsTestResultResponseInfo" + run_type: + $ref: "#/components/schemas/SyntheticsTestResultRunType" + sent_message: + description: Message sent to the target (for WebSocket/TCP/UDP tests). + example: udp mess + type: string + start_url: + description: Start URL for the test (browser tests). + example: http://34.95.79.70/prototype + type: string + started_at: + description: Timestamp of when the test started (in milliseconds). + example: 1723782422750 + format: int64 + type: integer + status: + $ref: "#/components/schemas/SyntheticsTestResultStatus" + steps: + description: Step results (for browser, mobile, and multistep API tests). + items: + $ref: "#/components/schemas/SyntheticsTestResultStep" + type: array + time_to_interactive: + description: Time to interactive in milliseconds (browser tests). + example: 183 + format: int64 + type: integer + timings: + additionalProperties: {} + description: Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). + example: + dns: 2.9 + download: 2.1 + firstByte: 95.2 + ssl: 187.9 + tcp: 92.6 + total: 380.7 + type: object + trace: + $ref: "#/components/schemas/SyntheticsTestResultTrace" + traceroute: + description: Traceroute hop results (for network tests). + items: + $ref: "#/components/schemas/SyntheticsTestResultTracerouteHop" + type: array + triggered_at: + description: Timestamp of when the test was triggered (in milliseconds). + example: 1723782422715 + format: int64 + type: integer + tunnel: + description: Whether the test was executed through a tunnel. + example: false + type: boolean + turns: + description: Turns executed by a goal-based browser test. + items: + $ref: "#/components/schemas/SyntheticsTestResultTurn" + type: array + unhealthy: + description: Whether the test runner was unhealthy at the time of execution. + example: false + type: boolean + variables: + $ref: "#/components/schemas/SyntheticsTestResultVariables" + type: object + SyntheticsTestResultDevice: + description: Device information for the test result (browser and mobile tests). + properties: + browser: + $ref: "#/components/schemas/SyntheticsTestResultDeviceBrowser" + id: + description: Device identifier. + example: chrome.laptop_large + type: string + name: + description: Device name. + example: "Chrome - Laptop Large" + type: string + platform: + $ref: "#/components/schemas/SyntheticsTestResultDevicePlatform" + resolution: + $ref: "#/components/schemas/SyntheticsTestResultDeviceResolution" + type: + description: Device type. + example: browser + type: string + type: object + SyntheticsTestResultDeviceBrowser: + description: Browser information for the device used to run the test. + properties: + type: + description: Browser type (for example, `chrome`, `firefox`). + example: edge + type: string + user_agent: + description: User agent string reported by the browser. + example: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36 Edg/127.0.2651.105 DatadogSynthetics + type: string + version: + description: Browser version. + example: 127.0.2651.105 + type: string + type: object + SyntheticsTestResultDevicePlatform: + description: Platform information for the device used to run the test. + properties: + name: + description: Platform name (for example, `linux`, `macos`). + example: ios + type: string + version: + description: Platform version. + example: "14.8" + type: string + type: object + SyntheticsTestResultDeviceResolution: + description: Screen resolution of the device used to run the test. + properties: + height: + description: Viewport height in pixels. + example: 1100 + format: int64 + type: integer + pixel_ratio: + description: Device pixel ratio. + example: 2 + format: double + type: number + width: + description: Viewport width in pixels. + example: 1440 + format: int64 + type: integer + type: object + SyntheticsTestResultDnsRecord: + description: A DNS record returned in a DNS test response. + properties: + type: + description: DNS record type (for example, `A`, `AAAA`, `CNAME`). + example: A + type: string + values: + description: Values associated with the DNS record. + example: + - 213.186.33.19 + items: + description: DNS record value. + type: string + type: array + type: object + SyntheticsTestResultDnsResolution: + description: DNS resolution details recorded during the test execution. + properties: + attempts: + description: DNS resolution attempts made during the test. + items: + $ref: "#/components/schemas/SyntheticsTestResultDnsResolutionAttempt" + type: array + resolved_ip: + description: Resolved IP address for the target host. + example: 54.243.255.141 + type: string + resolved_port: + description: Resolved port for the target service. + example: "443" + type: string + server: + description: DNS server used for the resolution. + example: 8.8.4.4 + type: string + type: object + SyntheticsTestResultDnsResolutionAttempt: + additionalProperties: + type: string + description: A single DNS resolution attempt. Keys are provider-specific attempt fields. + type: object + SyntheticsTestResultDuration: + description: Total duration of a Synthetic test execution. + properties: + has_duration: + description: Whether a duration was recorded for this execution. + example: true + type: boolean + value: + description: Duration value in milliseconds. + example: 380 + format: int64 + type: integer + type: object + SyntheticsTestResultExecutionInfo: + description: Execution details for a Synthetic test result. + properties: + duration: + $ref: "#/components/schemas/SyntheticsTestResultDuration" + error_message: + description: Error message if the execution encountered an issue. + example: Connection timed out + type: string + is_fast_retry: + description: Whether this result is from a fast retry. + example: true + type: boolean + timings: + additionalProperties: {} + description: Timing breakdown of the test execution in milliseconds. + example: + dns: 2.9 + download: 2.1 + firstByte: 95.2 + ssl: 187.9 + tcp: 92.6 + total: 380.7 + type: object + tunnel: + description: Whether the test was executed through a tunnel. + example: false + type: boolean + unhealthy: + description: Whether the location was unhealthy during execution. + example: false + type: boolean + type: object + SyntheticsTestResultFailure: + description: Details about the failure of a Synthetic test. + properties: + code: + description: Error code for the failure. + example: TIMEOUT + type: string + internal_code: + description: Internal error code used for debugging. + example: INCORRECT_ASSERTION + type: string + internal_message: + description: Internal error message used for debugging. + example: Assertion failed on step 2 + type: string + message: + description: Error message for the failure. + example: Connection timed out + type: string + type: object + SyntheticsTestResultFileRef: + description: Reference to a file attached to a Synthetic test request. + properties: + bucket_key: + description: Storage bucket key where the file is stored. + example: api-upload-file/s3v-msw-tp3/2024-08-20T12:18:27.628081_f433c953-a58a-4296-834b-0669e32ba55f.json + type: string + encoding: + description: Encoding of the file contents. + example: base64 + type: string + name: + description: File name. + example: dd_logo_h_rgb.jpg + type: string + size: + description: File size in bytes. + example: 30294 + format: int64 + type: integer + type: + description: File MIME type. + example: image/jpeg + type: string + type: object + SyntheticsTestResultGit: + description: Git information associated with the test result. + properties: + branch: + description: Git branch name. + example: main + type: string + commit: + $ref: "#/components/schemas/SyntheticsTestResultGitCommit" + repository_url: + description: Git repository URL. + example: https://github.com/DataDog/example + type: string + type: object + SyntheticsTestResultGitCommit: + description: Details of the Git commit associated with the test result. + properties: + author: + $ref: "#/components/schemas/SyntheticsTestResultGitUser" + committer: + $ref: "#/components/schemas/SyntheticsTestResultGitUser" + message: + description: Commit message. + example: Fix bug in login flow + type: string + sha: + description: Commit SHA. + example: 9e107d9d372bb6826bd81d3542a419d6f0e1de56 + type: string + url: + description: URL of the commit. + example: https://github.com/DataDog/example/commit/9e107d9d372bb6826bd81d3542a419d6f0e1de56 + type: string + type: object + SyntheticsTestResultGitUser: + description: A Git user (author or committer). + properties: + date: + description: Timestamp of the commit action for this user. + example: "2024-08-15T14:23:00Z" + type: string + email: + description: Email address of the Git user. + example: jane.doe@example.com + type: string + name: + description: Name of the Git user. + example: Jane Doe + type: string + type: object + SyntheticsTestResultHandshake: + description: Handshake request and response for protocol-level tests. + properties: + request: + $ref: "#/components/schemas/SyntheticsTestResultRequestInfo" + response: + $ref: "#/components/schemas/SyntheticsTestResultResponseInfo" + type: object + SyntheticsTestResultHealthCheck: + description: Health check information returned from a gRPC health check call. + properties: + message: + additionalProperties: + type: string + description: Raw health check message payload. + type: object + status: + description: Health check status code. + example: 1 + format: int64 + type: integer + type: object + SyntheticsTestResultIncludedItem: + description: An included related resource. + properties: + attributes: + additionalProperties: {} + description: Attributes of the included resource. + type: object + id: + description: ID of the included resource. + example: abc-def-123 + type: string + type: + description: Type of the included resource. + example: test + type: string + type: object + SyntheticsTestResultLocation: + description: Location information for a Synthetic test result. + properties: + id: + description: Identifier of the location. + example: aws:us-east-1 + type: string + name: + description: Human-readable name of the location. + example: "N. Virginia (AWS)" + type: string + version: + description: Version of the worker that ran the test. + example: 1.0.0 + type: string + worker_id: + description: Identifier of the specific worker that ran the test. + example: worker-abc-123 + type: string + type: object + SyntheticsTestResultNetpath: + description: Network Path test result capturing the path between source and destination. + properties: + destination: + $ref: "#/components/schemas/SyntheticsTestResultNetpathDestination" + hops: + description: Hops along the network path. + items: + $ref: "#/components/schemas/SyntheticsTestResultNetpathHop" + type: array + origin: + description: Origin of the network path (for example, probe source). + example: synthetics + type: string + pathtrace_id: + description: Identifier of the path trace. + example: 5d3cb978-533b-41ce-85a4-3661c8dd6a0b + type: string + protocol: + description: Protocol used for the path trace (for example, `tcp`, `udp`, `icmp`). + example: TCP + type: string + source: + $ref: "#/components/schemas/SyntheticsTestResultNetpathEndpoint" + tags: + description: Tags associated with the network path measurement. + example: + - synthetics.test_id:nja-epx-mg8 + items: + description: Tag associated with the network path measurement. + type: string + type: array + timestamp: + description: Unix timestamp (ms) of the network path measurement. + example: 1744117822266 + format: int64 + type: integer + type: object + SyntheticsTestResultNetpathDestination: + description: Destination endpoint of a network path measurement. + properties: + hostname: + description: Hostname of the destination. + example: 34.95.79.70 + type: string + ip_address: + description: IP address of the destination. + example: 34.95.79.70 + type: string + port: + description: Port of the destination service. + example: 80 + format: int64 + type: integer + type: object + SyntheticsTestResultNetpathEndpoint: + description: Source endpoint of a network path measurement. + properties: + hostname: + description: Hostname of the endpoint. + example: edge-eu1.staging.dog + type: string + type: object + SyntheticsTestResultNetpathHop: + description: A single hop along a network path. + properties: + hostname: + description: Resolved hostname of the hop. + example: 70.79.95.34.bc.googleusercontent.com + type: string + ip_address: + description: IP address of the hop. + example: 10.240.134.15 + type: string + reachable: + description: Whether this hop was reachable. + example: true + type: boolean + rtt: + description: Round-trip time to this hop in milliseconds. + example: 0.000346599 + format: double + type: number + ttl: + description: Time-to-live value of the probe packet at this hop. + example: 2 + format: int64 + type: integer + type: object + SyntheticsTestResultNetstats: + description: Aggregated network statistics from the test execution. + properties: + hops: + $ref: "#/components/schemas/SyntheticsTestResultNetstatsHops" + jitter: + description: Network jitter in milliseconds. + example: 0.08 + format: double + type: number + latency: + $ref: "#/components/schemas/SyntheticsTestResultNetworkLatency" + packet_loss_percentage: + description: Percentage of probe packets lost. + example: 0.0 + format: double + type: number + packets_received: + description: Number of probe packets received. + example: 4 + format: int64 + type: integer + packets_sent: + description: Number of probe packets sent. + example: 4 + format: int64 + type: integer + type: object + SyntheticsTestResultNetstatsHops: + description: Statistics about the number of hops for a network test. + properties: + avg: + description: Average number of hops. + example: 11.0 + format: double + type: number + max: + description: Maximum number of hops. + example: 11 + format: int64 + type: integer + min: + description: Minimum number of hops. + example: 11 + format: int64 + type: integer + type: object + SyntheticsTestResultNetworkLatency: + description: Latency statistics for a network probe. + properties: + avg: + description: Average latency in milliseconds. + example: 1.8805 + format: double + type: number + max: + description: Maximum latency in milliseconds. + example: 1.97 + format: double + type: number + min: + description: Minimum latency in milliseconds. + example: 1.76 + format: double + type: number + type: object + SyntheticsTestResultOCSPCertificate: + description: Certificate details returned in an OCSP response. + properties: + revocation_reason: + description: Reason code for the revocation, when applicable. + example: unspecified + type: string + revocation_time: + description: Unix timestamp (ms) of the revocation. + example: 1749727285000 + format: int64 + type: integer + serial_number: + description: Serial number of the certificate. + example: 7B584A1A6670A1EB0941A9A121569D60 + type: string + type: object + SyntheticsTestResultOCSPResponse: + description: OCSP response received while validating a certificate. + properties: + certificate: + $ref: "#/components/schemas/SyntheticsTestResultOCSPCertificate" + status: + description: OCSP response status (for example, `good`, `revoked`, `unknown`). + example: good + type: string + updates: + $ref: "#/components/schemas/SyntheticsTestResultOCSPUpdates" + type: object + SyntheticsTestResultOCSPUpdates: + description: OCSP response update timestamps. + properties: + next_update: + description: Unix timestamp (ms) of the next expected OCSP update. + example: 1743074486000 + format: int64 + type: integer + produced_at: + description: Unix timestamp (ms) of when the OCSP response was produced. + example: 1742469686000 + format: int64 + type: integer + this_update: + description: Unix timestamp (ms) of this OCSP update. + example: 1742469686000 + format: int64 + type: integer + type: object + SyntheticsTestResultParentStep: + description: Reference to the parent step of a sub-step. + properties: + id: + description: Identifier of the parent step. + example: fkk-j2a-gmw + type: string + type: object + SyntheticsTestResultParentTest: + description: Reference to the parent test of a sub-step. + properties: + id: + description: Identifier of the parent test. + example: abc-def-123 + type: string + type: object + SyntheticsTestResultRedirect: + description: A redirect hop encountered while performing the request. + properties: + location: + description: Target location of the redirect. + example: https://example.com/new-location + type: string + status_code: + description: HTTP status code of the redirect response. + example: 301 + format: int64 + type: integer + type: object + SyntheticsTestResultRelationshipTest: + description: Relationship to the Synthetic test. + properties: + data: + $ref: "#/components/schemas/SyntheticsTestResultRelationshipTestData" + type: object + SyntheticsTestResultRelationshipTestData: + description: Data for the test relationship. + properties: + id: + description: The public ID of the test. + example: abc-def-123 + type: string + type: + description: Type of the related resource. + example: test + type: string + type: object + SyntheticsTestResultRelationships: + description: Relationships for a Synthetic test result. + properties: + test: + $ref: "#/components/schemas/SyntheticsTestResultRelationshipTest" + type: object + SyntheticsTestResultRequestInfo: + description: Details of the outgoing request made during the test execution. + properties: + allow_insecure: + description: Whether insecure certificates are allowed for this request. + example: false + type: boolean + body: + description: Body sent with the request. + example: '{"key":"value"}' + type: string + call_type: + description: gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + example: unary + type: string + destination_service: + description: Destination service for a Network Path test. + example: my-service + type: string + dns_server: + description: DNS server used to resolve the target host. + example: 8.8.8.8 + type: string + dns_server_port: + description: Port of the DNS server used for resolution. + example: 53 + format: int64 + type: integer + e2e_queries: + description: Number of end-to-end probe queries issued. + example: 4 + format: int64 + type: integer + files: + description: Files attached to the request. + items: + $ref: "#/components/schemas/SyntheticsTestResultFileRef" + type: array + headers: + additionalProperties: {} + description: Headers sent with the request. + example: + content-type: application/json + type: object + host: + description: Host targeted by the request. + example: grpcbin.test.k6.io + type: string + max_ttl: + description: Maximum TTL for network probe packets. + example: 64 + format: int64 + type: integer + message: + description: Message sent with the request (for WebSocket/TCP/UDP tests). + example: My message + type: string + method: + description: HTTP method used for the request. + example: GET + type: string + no_saving_response_body: + description: Whether the response body was not saved. + example: true + type: boolean + port: + description: Port targeted by the request. Can be a number or a string variable reference. + example: 9000 + service: + description: Service name targeted by the request (for gRPC tests). + example: addsvc.Add + type: string + source_service: + description: Source service for a Network Path test. + example: synthetics + type: string + timeout: + description: Request timeout in milliseconds. + example: 60 + format: int64 + type: integer + tool_name: + description: Name of the MCP tool called (MCP tests only). + example: search + type: string + traceroute_queries: + description: Number of traceroute probe queries issued. + example: 2 + format: int64 + type: integer + url: + description: URL targeted by the request. + example: https://httpbin.org/anything/lol valuehugo + type: string + type: object + SyntheticsTestResultResponse: + description: Response object for a Synthetic test result. + properties: + data: + $ref: "#/components/schemas/SyntheticsTestResultData" + included: + description: Array of included related resources, such as the test definition. + items: + $ref: "#/components/schemas/SyntheticsTestResultIncludedItem" + type: array + type: object + SyntheticsTestResultResponseInfo: + description: Details of the response received during the test execution. + properties: + body: + description: Body of the response. + example: '{"status":"ok"}' + type: string + body_compressed: + description: Compressed representation of the response body. + example: eJzLSM3JyQcABiwCFQ== + type: string + body_hashes: + description: Hashes computed over the response body. + example: 9e107d9d372bb6826bd81d3542a419d6 + type: string + body_size: + description: Size of the response body in bytes. + example: 793 + format: int64 + type: integer + cache_headers: + additionalProperties: + type: string + description: Cache-related response headers. + example: + server: gunicorn/19.9.0 + type: object + cdn: + $ref: "#/components/schemas/SyntheticsTestResultCdnProviderInfo" + close: + $ref: "#/components/schemas/SyntheticsTestResultWebSocketClose" + compressed_message: + description: Compressed representation of the response message. + example: eJzLSM3JyQcABiwCFQ== + type: string + headers: + additionalProperties: {} + description: Response headers. + example: + content-type: application/json + type: object + healthcheck: + $ref: "#/components/schemas/SyntheticsTestResultHealthCheck" + http_version: + description: HTTP version of the response. + example: "2.0" + type: string + is_body_truncated: + description: Whether the response body was truncated. + example: false + type: boolean + is_message_truncated: + description: Whether the response message was truncated. + example: false + type: boolean + message: + description: Message received in the response (for WebSocket/TCP/UDP tests). + example: '{"f_string":"concat-STATIC_HIDDEN_VALUE"}' + type: string + metadata: + additionalProperties: + type: string + description: Additional metadata returned with the response. + type: object + records: + description: DNS records returned in the response (DNS tests only). + items: + $ref: "#/components/schemas/SyntheticsTestResultDnsRecord" + type: array + redirects: + description: Redirect hops encountered while performing the request. + items: + $ref: "#/components/schemas/SyntheticsTestResultRedirect" + type: array + status_code: + description: HTTP status code of the response. + example: 200 + format: int64 + type: integer + type: object + SyntheticsTestResultRouter: + description: A router along the traceroute path. + properties: + ip: + description: IP address of the router. + example: 34.95.79.70 + type: string + resolved_host: + description: Resolved hostname of the router. + example: 70.79.95.34.bc.googleusercontent.com + type: string + type: object + SyntheticsTestResultRumContext: + description: RUM application context associated with a step or sub-test. + properties: + application_id: + description: RUM application identifier. + example: 00000000-0000-0000-0000-000000000000 + type: string + session_id: + description: RUM session identifier. + example: 11111111-1111-1111-1111-111111111111 + type: string + view_id: + description: RUM view identifier. + example: 22222222-2222-2222-2222-222222222222 + type: string + type: object + SyntheticsTestResultRunType: + description: The type of run for a Synthetic test result. + enum: + - scheduled + - fast + - ci + - triggered + example: scheduled + type: string + x-enum-varnames: + - SCHEDULED + - FAST + - CI + - TRIGGERED + SyntheticsTestResultStatus: + description: Status of a Synthetic test result. + enum: + - passed + - failed + - no_data + example: passed + type: string + x-enum-varnames: + - PASSED + - FAILED + - NO_DATA + SyntheticsTestResultStep: + description: A step result from a browser, mobile, or multistep API test. + properties: + allow_failure: + description: Whether the test continues when this step fails. + example: false + type: boolean + api_test: + additionalProperties: {} + description: Inner API test definition for browser `runApiTest` steps. + type: object + assertion_result: + $ref: "#/components/schemas/SyntheticsTestResultStepAssertionResult" + assertions: + description: Assertion results produced by the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultAssertionResult" + type: array + blocked_requests_urls: + description: URLs of requests blocked during the step. + items: + description: Blocked request URL. + type: string + type: array + bounds: + $ref: "#/components/schemas/SyntheticsTestResultBounds" + browser_errors: + description: Browser errors captured during the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultBrowserError" + type: array + bucket_keys: + $ref: "#/components/schemas/SyntheticsTestResultBucketKeys" + cdn_resources: + description: CDN resources encountered during the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultCdnResource" + type: array + click_type: + description: Click type performed in a browser step. + example: primary + type: string + compressed_json_descriptor: + description: Compressed JSON descriptor for the step (internal format). + example: compressedJsonDescriptorValue + type: string + config: + additionalProperties: {} + description: Request configuration executed by this step (API test steps). + type: object + description: + description: Human-readable description of the step. + example: Navigate to start URL + type: string + duration: + description: Duration of the step in milliseconds. + example: 1015.0 + format: double + type: number + element_description: + description: Description of the element interacted with by the step. + example: '' + type: string + element_updates: + $ref: "#/components/schemas/SyntheticsTestResultStepElementUpdates" + extracted_value: + $ref: "#/components/schemas/SyntheticsTestResultVariable" + failure: + $ref: "#/components/schemas/SyntheticsTestResultFailure" + http_results: + description: HTTP results produced by an MCP step. + items: + $ref: "#/components/schemas/SyntheticsTestResultAssertionResult" + type: array + id: + description: Identifier of the step. + example: fkk-j2a-gmw + type: string + is_critical: + description: Whether this step is critical for the test outcome. + example: true + type: boolean + javascript_custom_assertion_code: + description: Whether the step uses a custom JavaScript assertion. + example: false + type: boolean + locate_element_duration: + description: Time taken to locate the element in milliseconds. + example: 845.0 + format: double + type: number + name: + description: Name of the step. + example: Extract variable from body + type: string + request: + $ref: "#/components/schemas/SyntheticsTestResultRequestInfo" + response: + $ref: "#/components/schemas/SyntheticsTestResultResponseInfo" + retries: + description: Retry results for the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultStep" + type: array + retry_count: + description: Number of times this step was retried. + example: 0 + format: int64 + type: integer + rum_context: + $ref: "#/components/schemas/SyntheticsTestResultRumContext" + started_at: + description: Unix timestamp (ms) of when the step started. + example: 1724445283308 + format: int64 + type: integer + status: + description: Status of the step (for example, `passed`, `failed`). + example: passed + type: string + sub_step: + $ref: "#/components/schemas/SyntheticsTestResultSubStep" + sub_test: + $ref: "#/components/schemas/SyntheticsTestResultSubTest" + subtype: + description: Subtype of the step. + example: http + type: string + tabs: + description: Browser tabs involved in the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultTab" + type: array + timings: + additionalProperties: {} + description: Timing breakdown of the step execution. + type: object + tunnel: + description: Whether the step was executed through a Synthetics tunnel. + example: false + type: boolean + type: + description: Type of the step (for example, `click`, `assertElementContent`, `runApiTest`). + example: click + type: string + url: + description: URL associated with the step (for navigation steps). + example: http://34.95.79.70/prototype + type: string + value: + description: Step value. Its type depends on the step type. + example: http://34.95.79.70/prototype + variables: + $ref: "#/components/schemas/SyntheticsTestResultVariables" + vitals_metrics: + description: Web vitals metrics captured during the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultVitalsMetrics" + type: array + warnings: + description: Warnings emitted during the step. + items: + $ref: "#/components/schemas/SyntheticsTestResultWarning" + type: array + type: object + SyntheticsTestResultStepAssertionResult: + description: Assertion result for a browser or mobile step. + properties: + actual: + description: Actual value observed during the step assertion. Its type depends on the check type. + example: "True\ngood\ngood\ngood\ngood\nTrue" + check_type: + description: Type of the step assertion check. + example: contains + type: string + expected: + description: Expected value for the step assertion. Its type depends on the check type. + example: True good good good good True + has_secure_variables: + description: Whether the assertion involves secure variables. + example: false + type: boolean + type: object + SyntheticsTestResultStepElementUpdates: + description: Element locator updates produced during a step. + properties: + multi_locator: + additionalProperties: + type: string + description: Updated multi-locator definition. + type: object + target_outer_html: + description: Updated outer HTML of the targeted element. + example:

My website - v4

+ type: string + version: + description: Version of the element locator definition. + example: 3 + format: int64 + type: integer + type: object + SyntheticsTestResultStepsInfo: + description: Step execution summary for a Synthetic test result. + properties: + completed: + description: Number of completed steps. + example: 6 + format: int64 + type: integer + errors: + description: Number of steps with errors. + example: 0 + format: int64 + type: integer + total: + description: Total number of steps. + example: 6 + format: int64 + type: integer + type: object + SyntheticsTestResultSubStep: + description: Information about a sub-step in a nested test execution. + properties: + level: + description: Depth of the sub-step in the execution tree. + example: 1 + format: int64 + type: integer + parent_step: + $ref: "#/components/schemas/SyntheticsTestResultParentStep" + parent_test: + $ref: "#/components/schemas/SyntheticsTestResultParentTest" + type: object + SyntheticsTestResultSubTest: + description: Information about a sub-test played from a parent browser test. + properties: + id: + description: Identifier of the sub-test. + example: abc-def-123 + type: string + playing_tab: + description: Index of the browser tab playing the sub-test. + example: 0 + format: int64 + type: integer + rum_context: + $ref: "#/components/schemas/SyntheticsTestResultRumContext" + type: object + SyntheticsTestResultSummaryAttributes: + description: Attributes of a Synthetic test result summary. + properties: + device: + $ref: "#/components/schemas/SyntheticsTestResultDevice" + execution_info: + $ref: "#/components/schemas/SyntheticsTestResultExecutionInfo" + finished_at: + description: Timestamp of when the test finished (in milliseconds). + format: int64 + type: integer + location: + $ref: "#/components/schemas/SyntheticsTestResultLocation" + run_type: + $ref: "#/components/schemas/SyntheticsTestResultRunType" + started_at: + description: Timestamp of when the test started (in milliseconds). + format: int64 + type: integer + status: + $ref: "#/components/schemas/SyntheticsTestResultStatus" + steps_info: + $ref: "#/components/schemas/SyntheticsTestResultStepsInfo" + test_sub_type: + $ref: "#/components/schemas/SyntheticsTestSubType" + test_type: + $ref: "#/components/schemas/SyntheticsTestType" + type: object + SyntheticsTestResultSummaryData: + description: Wrapper object for a Synthetic test result summary. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestResultSummaryAttributes" + id: + description: The result ID. + example: "5158904793181869365" + type: string + relationships: + $ref: "#/components/schemas/SyntheticsTestResultRelationships" + type: + $ref: "#/components/schemas/SyntheticsTestResultSummaryType" + type: object + SyntheticsTestResultSummaryType: + default: "result_summary" + description: Type of the Synthetic test result summary resource, `result_summary`. + enum: + - result_summary + example: result_summary + type: string + x-enum-varnames: + - RESULT_SUMMARY + SyntheticsTestResultTab: + description: Information about a browser tab involved in a step. + properties: + focused: + description: Whether the tab was focused during the step. + example: true + type: boolean + title: + description: Title of the tab. + example: Team Browser mini-websites + type: string + url: + description: URL loaded in the tab. + example: http://34.95.79.70/prototype + type: string + type: object + SyntheticsTestResultTrace: + description: Trace identifiers associated with a Synthetic test result. + properties: + id: + description: Datadog APM trace identifier. + example: "5513046492231128177" + type: string + otel_id: + description: OpenTelemetry trace identifier. + example: d8ba00eb1507bdba8643ba8e7a1c022c + type: string + type: object + SyntheticsTestResultTracerouteHop: + description: A network probe result, used for traceroute hops and ping summaries. + properties: + host: + description: Target hostname. + example: 34.95.79.70 + type: string + latency: + $ref: "#/components/schemas/SyntheticsTestResultNetworkLatency" + packet_loss_percentage: + description: Percentage of probe packets lost. + example: 0.0 + format: double + type: number + packet_size: + description: Size of each probe packet in bytes. + example: 56 + format: int64 + type: integer + packets_received: + description: Number of probe packets received. + example: 4 + format: int64 + type: integer + packets_sent: + description: Number of probe packets sent. + example: 4 + format: int64 + type: integer + resolved_ip: + description: Resolved IP address for the target. + example: 34.95.79.70 + type: string + routers: + description: List of intermediate routers for the traceroute. + items: + $ref: "#/components/schemas/SyntheticsTestResultRouter" + type: array + type: object + SyntheticsTestResultTurn: + description: A turn in a goal-based browser test, grouping steps and reasoning. + properties: + bucket_keys: + $ref: "#/components/schemas/SyntheticsTestResultBucketKeys" + name: + description: Name of the turn. + example: Turn 1 + type: string + reasoning: + description: Agent reasoning produced for this turn. + example: I need to navigate to the chairs section + type: string + status: + description: Status of the turn (for example, `passed`, `failed`). + example: passed + type: string + steps: + description: Steps executed during the turn. + items: + $ref: "#/components/schemas/SyntheticsTestResultTurnStep" + type: array + turn_finished_at: + description: Unix timestamp (ms) of when the turn finished. + example: 1724521438800 + format: int64 + type: integer + turn_started_at: + description: Unix timestamp (ms) of when the turn started. + example: 1724521436800 + format: int64 + type: integer + type: object + SyntheticsTestResultTurnStep: + description: A step executed during a goal-based browser test turn. + properties: + bucket_keys: + $ref: "#/components/schemas/SyntheticsTestResultBucketKeys" + config: + additionalProperties: {} + description: Browser step configuration for this turn step. + example: + id: step-1 + name: Click on div "Chairs" + type: click + type: object + type: object + SyntheticsTestResultType: + default: "result" + description: Type of the Synthetic test result resource, `result`. + enum: + - result + example: result + type: string + x-enum-varnames: + - RESULT + SyntheticsTestResultVariable: + description: A variable used or extracted during a test. + properties: + err: + description: Error encountered when evaluating the variable. + example: LOCAL_VARIABLE_UNKNOWN + type: string + error_message: + description: Human-readable error message for variable evaluation. + example: Unknown variable name undefined. + type: string + example: + description: Example value for the variable. + example: lol value + type: string + id: + description: Variable identifier. + example: c896702c-1e34-4e62-a67b-432e8092d062 + type: string + name: + description: Variable name. + example: HEADER_VALUE + type: string + pattern: + description: Pattern used to extract the variable. + example: lol value + type: string + secure: + description: Whether the variable holds a secure value. + example: false + type: boolean + type: + description: Variable type. + example: text + type: string + val: + description: Evaluated value of the variable. + example: value-to-extract + type: string + value: + description: Current value of the variable. + example: lol value + type: string + type: object + SyntheticsTestResultVariables: + description: Variables captured during a test step. + properties: + config: + description: Variables defined in the test configuration. + items: + $ref: "#/components/schemas/SyntheticsTestResultVariable" + type: array + extracted: + description: Variables extracted during the test execution. + items: + $ref: "#/components/schemas/SyntheticsTestResultVariable" + type: array + type: object + SyntheticsTestResultVitalsMetrics: + description: Web vitals metrics captured during a browser test step. + properties: + cls: + description: Cumulative Layout Shift score. + example: 0.0 + format: double + type: number + fcp: + description: First Contentful Paint in milliseconds. + example: 120.3 + format: double + type: number + inp: + description: Interaction to Next Paint in milliseconds. + example: 85.0 + format: double + type: number + lcp: + description: Largest Contentful Paint in milliseconds. + example: 210.5 + format: double + type: number + ttfb: + description: Time To First Byte in milliseconds. + example: 95.2 + format: double + type: number + url: + description: URL that produced the metrics. + example: http://34.95.79.70/prototype + type: string + type: object + SyntheticsTestResultWarning: + description: A warning captured during a browser test step. + properties: + element_bounds: + description: Bounds of elements related to the warning. + items: + $ref: "#/components/schemas/SyntheticsTestResultBounds" + type: array + message: + description: Warning message. + example: Element is not visible in the viewport + type: string + type: + description: Type of the warning. + example: visibility + type: string + type: object + SyntheticsTestResultWebSocketClose: + description: WebSocket close frame information for WebSocket test responses. + properties: + reason: + description: Reason string received in the close frame. + example: Normal closure + type: string + status_code: + description: Status code received in the close frame. + example: 1000 + format: int64 + type: integer + type: object + SyntheticsTestSubType: + description: Subtype of the Synthetic test that produced this result. + enum: + - dns + - grpc + - http + - icmp + - mcp + - multi + - ssl + - tcp + - udp + - websocket + example: http + type: string + x-enum-varnames: + - DNS + - GRPC + - HTTP + - ICMP + - MCP + - MULTI + - SSL + - TCP + - UDP + - WEBSOCKET + SyntheticsTestType: + description: Type of the Synthetic test that produced this result. + enum: + - api + - browser + - mobile + - network + example: api + type: string + x-enum-varnames: + - API + - BROWSER + - MOBILE + - NETWORK SyntheticsTestVersionActionMetadata: description: Object containing metadata about a change action. properties: @@ -125200,6 +127095,207 @@ paths: permissions: - synthetics_write - synthetics_create_edit_trigger + /api/v2/synthetics/tests/browser/{public_id}/results: + get: + description: Get the latest result summaries for a given Synthetic browser test. + operationId: ListSyntheticsBrowserTestLatestResults + parameters: + - description: The public ID of the Synthetic browser test for which to search results. + in: path + name: public_id + required: true + schema: + type: string + - description: Timestamp in milliseconds from which to start querying results. + in: query + name: from_ts + required: false + schema: + format: int64 + type: integer + - description: Timestamp in milliseconds up to which to query results. + in: query + name: to_ts + required: false + schema: + format: int64 + type: integer + - description: Filter results by status. + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/SyntheticsTestResultStatus" + - description: Filter results by run type. + in: query + name: runType + required: false + schema: + $ref: "#/components/schemas/SyntheticsTestResultRunType" + - description: Locations for which to query results. + in: query + name: probe_dc + required: false + schema: + items: + type: string + type: array + - description: Device IDs for which to query results. + in: query + name: device_id + required: false + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + device: + id: chrome.laptop_large + name: "Chrome - Laptop Large" + type: browser + finished_at: 1679328005200 + location: + id: aws:eu-west-1 + name: "Ireland (AWS)" + run_type: scheduled + started_at: 1679328000000 + status: passed + test_type: browser + test_version: 2 + id: "7291038456723891045" + relationships: + test: + data: + id: xyz-abc-789 + type: test + type: result_summary + schema: + $ref: "#/components/schemas/SyntheticsTestLatestResultsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a browser test's latest results + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/browser/{public_id}/results/{result_id}: + get: + description: Get a specific full result from a given Synthetic browser test. + operationId: GetSyntheticsBrowserTestResult + parameters: + - description: The public ID of the Synthetic browser test to which the target result belongs. + in: path + name: public_id + required: true + schema: + type: string + - description: The ID of the result to get. + in: path + name: result_id + required: true + schema: + type: string + - description: The event ID used to look up the result in the event store. + in: query + name: event_id + required: false + schema: + type: string + - description: Timestamp in seconds to look up the result. + in: query + name: timestamp + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + device: + id: chrome.laptop_large + name: "Chrome - Laptop Large" + type: browser + location: + id: aws:eu-west-1 + name: "Ireland (AWS)" + result: + duration: 5200.0 + finished_at: 1679328005200 + id: "7291038456723891045" + started_at: 1679328000000 + status: passed + test_type: browser + test_version: 2 + id: "7291038456723891045" + relationships: + test: + data: + id: xyz-abc-789 + type: test + type: result + schema: + $ref: "#/components/schemas/SyntheticsTestResultResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a browser test result + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/tests/bulk-delete: post: operationId: DeleteSyntheticsTests @@ -125266,6 +127362,27 @@ paths: "200": content: application/json: + examples: + default: + value: + data: + attributes: + location: + id: aws:us-east-1 + name: "N. Virginia (AWS)" + result: + duration: 150.5 + finished_at: 1679328001000 + id: abc12345-1234-1234-1234-abc123456789 + resolved_ip: "1.2.3.4" + run_type: fast + started_at: 1679328000000 + status: passed + test_sub_type: http + test_type: api + test_version: 1 + id: abc12345-1234-1234-1234-abc123456789 + type: result schema: $ref: "#/components/schemas/SyntheticsFastTestResult" description: OK @@ -125511,6 +127628,77 @@ paths: permissions: - synthetics_write - synthetics_create_edit_trigger + /api/v2/synthetics/tests/poll_results: + get: + description: |- + Poll for test results given a list of result IDs. This is typically used after + triggering tests with CI/CD to retrieve results once they are available. + operationId: PollSyntheticsTestResults + parameters: + - description: A JSON-encoded array of result IDs to poll for. + example: '["id1","id2","id3"]' + in: query + name: result_ids + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + location: + id: aws:us-east-1 + name: "N. Virginia (AWS)" + result: + duration: 150.5 + finished_at: 1679328001000 + id: "5158904793181869365" + started_at: 1679328000000 + status: passed + test_sub_type: http + test_type: api + test_version: 3 + id: "5158904793181869365" + relationships: + test: + data: + id: abc-def-123 + type: test + type: result + schema: + $ref: "#/components/schemas/SyntheticsPollTestResultsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Poll for test results + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/tests/{public_id}/files/download: post: description: |- @@ -125804,6 +127992,201 @@ paths: operator: OR permissions: - synthetics_read + /api/v2/synthetics/tests/{public_id}/results: + get: + description: Get the latest result summaries for a given Synthetic test. + operationId: ListSyntheticsTestLatestResults + parameters: + - description: The public ID of the Synthetic test for which to search results. + in: path + name: public_id + required: true + schema: + type: string + - description: Timestamp in milliseconds from which to start querying results. + in: query + name: from_ts + required: false + schema: + format: int64 + type: integer + - description: Timestamp in milliseconds up to which to query results. + in: query + name: to_ts + required: false + schema: + format: int64 + type: integer + - description: Filter results by status. + in: query + name: status + required: false + schema: + $ref: "#/components/schemas/SyntheticsTestResultStatus" + - description: Filter results by run type. + in: query + name: runType + required: false + schema: + $ref: "#/components/schemas/SyntheticsTestResultRunType" + - description: Locations for which to query results. + in: query + name: probe_dc + required: false + schema: + items: + type: string + type: array + - description: Device IDs for which to query results. + in: query + name: device_id + required: false + schema: + items: + type: string + type: array + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + finished_at: 1679328001000 + location: + id: aws:us-east-1 + name: "N. Virginia (AWS)" + run_type: scheduled + started_at: 1679328000000 + status: passed + test_sub_type: http + test_type: api + test_version: 3 + id: "5158904793181869365" + relationships: + test: + data: + id: abc-def-123 + type: test + type: result_summary + schema: + $ref: "#/components/schemas/SyntheticsTestLatestResultsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a test's latest results + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/results/{result_id}: + get: + description: Get a specific full result from a given Synthetic test. + operationId: GetSyntheticsTestResult + parameters: + - description: The public ID of the Synthetic test to which the target result belongs. + in: path + name: public_id + required: true + schema: + type: string + - description: The ID of the result to get. + in: path + name: result_id + required: true + schema: + type: string + - description: The event ID used to look up the result in the event store. + in: query + name: event_id + required: false + schema: + type: string + - description: Timestamp in seconds to look up the result. + in: query + name: timestamp + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + location: + id: aws:us-east-1 + name: "N. Virginia (AWS)" + result: + duration: 150.5 + finished_at: 1679328001000 + id: "5158904793181869365" + started_at: 1679328000000 + status: passed + test_sub_type: http + test_type: api + test_version: 3 + id: "5158904793181869365" + relationships: + test: + data: + id: abc-def-123 + type: test + type: result + schema: + $ref: "#/components/schemas/SyntheticsTestResultResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a test result + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/tests/{public_id}/version_history: get: description: Get the paginated version history for a Synthetic test. diff --git a/api/datadogV2/api_synthetics.go b/api/datadogV2/api_synthetics.go index acc30677bee..6413717470c 100644 --- a/api/datadogV2/api_synthetics.go +++ b/api/datadogV2/api_synthetics.go @@ -8,6 +8,7 @@ import ( _context "context" _nethttp "net/http" _neturl "net/url" + "reflect" "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) @@ -795,6 +796,123 @@ func (a *SyntheticsApi) GetOnDemandConcurrencyCap(ctx _context.Context) (OnDeman return localVarReturnValue, localVarHTTPResponse, nil } +// GetSyntheticsBrowserTestResultOptionalParameters holds optional parameters for GetSyntheticsBrowserTestResult. +type GetSyntheticsBrowserTestResultOptionalParameters struct { + EventId *string + Timestamp *int64 +} + +// NewGetSyntheticsBrowserTestResultOptionalParameters creates an empty struct for parameters. +func NewGetSyntheticsBrowserTestResultOptionalParameters() *GetSyntheticsBrowserTestResultOptionalParameters { + this := GetSyntheticsBrowserTestResultOptionalParameters{} + return &this +} + +// WithEventId sets the corresponding parameter name and returns the struct. +func (r *GetSyntheticsBrowserTestResultOptionalParameters) WithEventId(eventId string) *GetSyntheticsBrowserTestResultOptionalParameters { + r.EventId = &eventId + return r +} + +// WithTimestamp sets the corresponding parameter name and returns the struct. +func (r *GetSyntheticsBrowserTestResultOptionalParameters) WithTimestamp(timestamp int64) *GetSyntheticsBrowserTestResultOptionalParameters { + r.Timestamp = ×tamp + return r +} + +// GetSyntheticsBrowserTestResult Get a browser test result. +// Get a specific full result from a given Synthetic browser test. +func (a *SyntheticsApi) GetSyntheticsBrowserTestResult(ctx _context.Context, publicId string, resultId string, o ...GetSyntheticsBrowserTestResultOptionalParameters) (SyntheticsTestResultResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SyntheticsTestResultResponse + optionalParams GetSyntheticsBrowserTestResultOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSyntheticsBrowserTestResultOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SyntheticsApi.GetSyntheticsBrowserTestResult") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/synthetics/tests/browser/{public_id}/results/{result_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{result_id}", _neturl.PathEscape(datadog.ParameterToString(resultId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.EventId != nil { + localVarQueryParams.Add("event_id", datadog.ParameterToString(*optionalParams.EventId, "")) + } + if optionalParams.Timestamp != nil { + localVarQueryParams.Add("timestamp", datadog.ParameterToString(*optionalParams.Timestamp, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // GetSyntheticsFastTestResult Get a fast test result. func (a *SyntheticsApi) GetSyntheticsFastTestResult(ctx _context.Context, id string) (SyntheticsFastTestResult, *_nethttp.Response, error) { @@ -1029,6 +1147,123 @@ func (a *SyntheticsApi) GetSyntheticsSuite(ctx _context.Context, publicId string return localVarReturnValue, localVarHTTPResponse, nil } +// GetSyntheticsTestResultOptionalParameters holds optional parameters for GetSyntheticsTestResult. +type GetSyntheticsTestResultOptionalParameters struct { + EventId *string + Timestamp *int64 +} + +// NewGetSyntheticsTestResultOptionalParameters creates an empty struct for parameters. +func NewGetSyntheticsTestResultOptionalParameters() *GetSyntheticsTestResultOptionalParameters { + this := GetSyntheticsTestResultOptionalParameters{} + return &this +} + +// WithEventId sets the corresponding parameter name and returns the struct. +func (r *GetSyntheticsTestResultOptionalParameters) WithEventId(eventId string) *GetSyntheticsTestResultOptionalParameters { + r.EventId = &eventId + return r +} + +// WithTimestamp sets the corresponding parameter name and returns the struct. +func (r *GetSyntheticsTestResultOptionalParameters) WithTimestamp(timestamp int64) *GetSyntheticsTestResultOptionalParameters { + r.Timestamp = ×tamp + return r +} + +// GetSyntheticsTestResult Get a test result. +// Get a specific full result from a given Synthetic test. +func (a *SyntheticsApi) GetSyntheticsTestResult(ctx _context.Context, publicId string, resultId string, o ...GetSyntheticsTestResultOptionalParameters) (SyntheticsTestResultResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SyntheticsTestResultResponse + optionalParams GetSyntheticsTestResultOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSyntheticsTestResultOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SyntheticsApi.GetSyntheticsTestResult") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/synthetics/tests/{public_id}/results/{result_id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{result_id}", _neturl.PathEscape(datadog.ParameterToString(resultId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.EventId != nil { + localVarQueryParams.Add("event_id", datadog.ParameterToString(*optionalParams.EventId, "")) + } + if optionalParams.Timestamp != nil { + localVarQueryParams.Add("timestamp", datadog.ParameterToString(*optionalParams.Timestamp, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // GetSyntheticsTestVersionOptionalParameters holds optional parameters for GetSyntheticsTestVersion. type GetSyntheticsTestVersionOptionalParameters struct { IncludeChangeMetadata *bool @@ -1388,6 +1623,350 @@ func (a *SyntheticsApi) GetTestParentSuites(ctx _context.Context, publicId strin return localVarReturnValue, localVarHTTPResponse, nil } +// ListSyntheticsBrowserTestLatestResultsOptionalParameters holds optional parameters for ListSyntheticsBrowserTestLatestResults. +type ListSyntheticsBrowserTestLatestResultsOptionalParameters struct { + FromTs *int64 + ToTs *int64 + Status *SyntheticsTestResultStatus + RunType *SyntheticsTestResultRunType + ProbeDc *[]string + DeviceId *[]string +} + +// NewListSyntheticsBrowserTestLatestResultsOptionalParameters creates an empty struct for parameters. +func NewListSyntheticsBrowserTestLatestResultsOptionalParameters() *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + this := ListSyntheticsBrowserTestLatestResultsOptionalParameters{} + return &this +} + +// WithFromTs sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithFromTs(fromTs int64) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.FromTs = &fromTs + return r +} + +// WithToTs sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithToTs(toTs int64) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.ToTs = &toTs + return r +} + +// WithStatus sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithStatus(status SyntheticsTestResultStatus) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.Status = &status + return r +} + +// WithRunType sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithRunType(runType SyntheticsTestResultRunType) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.RunType = &runType + return r +} + +// WithProbeDc sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithProbeDc(probeDc []string) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.ProbeDc = &probeDc + return r +} + +// WithDeviceId sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsBrowserTestLatestResultsOptionalParameters) WithDeviceId(deviceId []string) *ListSyntheticsBrowserTestLatestResultsOptionalParameters { + r.DeviceId = &deviceId + return r +} + +// ListSyntheticsBrowserTestLatestResults Get a browser test's latest results. +// Get the latest result summaries for a given Synthetic browser test. +func (a *SyntheticsApi) ListSyntheticsBrowserTestLatestResults(ctx _context.Context, publicId string, o ...ListSyntheticsBrowserTestLatestResultsOptionalParameters) (SyntheticsTestLatestResultsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SyntheticsTestLatestResultsResponse + optionalParams ListSyntheticsBrowserTestLatestResultsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSyntheticsBrowserTestLatestResultsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SyntheticsApi.ListSyntheticsBrowserTestLatestResults") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/synthetics/tests/browser/{public_id}/results" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FromTs != nil { + localVarQueryParams.Add("from_ts", datadog.ParameterToString(*optionalParams.FromTs, "")) + } + if optionalParams.ToTs != nil { + localVarQueryParams.Add("to_ts", datadog.ParameterToString(*optionalParams.ToTs, "")) + } + if optionalParams.Status != nil { + localVarQueryParams.Add("status", datadog.ParameterToString(*optionalParams.Status, "")) + } + if optionalParams.RunType != nil { + localVarQueryParams.Add("runType", datadog.ParameterToString(*optionalParams.RunType, "")) + } + if optionalParams.ProbeDc != nil { + t := *optionalParams.ProbeDc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("probe_dc", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("probe_dc", datadog.ParameterToString(t, "multi")) + } + } + if optionalParams.DeviceId != nil { + t := *optionalParams.DeviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("device_id", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("device_id", datadog.ParameterToString(t, "multi")) + } + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListSyntheticsTestLatestResultsOptionalParameters holds optional parameters for ListSyntheticsTestLatestResults. +type ListSyntheticsTestLatestResultsOptionalParameters struct { + FromTs *int64 + ToTs *int64 + Status *SyntheticsTestResultStatus + RunType *SyntheticsTestResultRunType + ProbeDc *[]string + DeviceId *[]string +} + +// NewListSyntheticsTestLatestResultsOptionalParameters creates an empty struct for parameters. +func NewListSyntheticsTestLatestResultsOptionalParameters() *ListSyntheticsTestLatestResultsOptionalParameters { + this := ListSyntheticsTestLatestResultsOptionalParameters{} + return &this +} + +// WithFromTs sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithFromTs(fromTs int64) *ListSyntheticsTestLatestResultsOptionalParameters { + r.FromTs = &fromTs + return r +} + +// WithToTs sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithToTs(toTs int64) *ListSyntheticsTestLatestResultsOptionalParameters { + r.ToTs = &toTs + return r +} + +// WithStatus sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithStatus(status SyntheticsTestResultStatus) *ListSyntheticsTestLatestResultsOptionalParameters { + r.Status = &status + return r +} + +// WithRunType sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithRunType(runType SyntheticsTestResultRunType) *ListSyntheticsTestLatestResultsOptionalParameters { + r.RunType = &runType + return r +} + +// WithProbeDc sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithProbeDc(probeDc []string) *ListSyntheticsTestLatestResultsOptionalParameters { + r.ProbeDc = &probeDc + return r +} + +// WithDeviceId sets the corresponding parameter name and returns the struct. +func (r *ListSyntheticsTestLatestResultsOptionalParameters) WithDeviceId(deviceId []string) *ListSyntheticsTestLatestResultsOptionalParameters { + r.DeviceId = &deviceId + return r +} + +// ListSyntheticsTestLatestResults Get a test's latest results. +// Get the latest result summaries for a given Synthetic test. +func (a *SyntheticsApi) ListSyntheticsTestLatestResults(ctx _context.Context, publicId string, o ...ListSyntheticsTestLatestResultsOptionalParameters) (SyntheticsTestLatestResultsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SyntheticsTestLatestResultsResponse + optionalParams ListSyntheticsTestLatestResultsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListSyntheticsTestLatestResultsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SyntheticsApi.ListSyntheticsTestLatestResults") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/synthetics/tests/{public_id}/results" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{public_id}", _neturl.PathEscape(datadog.ParameterToString(publicId, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.FromTs != nil { + localVarQueryParams.Add("from_ts", datadog.ParameterToString(*optionalParams.FromTs, "")) + } + if optionalParams.ToTs != nil { + localVarQueryParams.Add("to_ts", datadog.ParameterToString(*optionalParams.ToTs, "")) + } + if optionalParams.Status != nil { + localVarQueryParams.Add("status", datadog.ParameterToString(*optionalParams.Status, "")) + } + if optionalParams.RunType != nil { + localVarQueryParams.Add("runType", datadog.ParameterToString(*optionalParams.RunType, "")) + } + if optionalParams.ProbeDc != nil { + t := *optionalParams.ProbeDc + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("probe_dc", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("probe_dc", datadog.ParameterToString(t, "multi")) + } + } + if optionalParams.DeviceId != nil { + t := *optionalParams.DeviceId + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("device_id", datadog.ParameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("device_id", datadog.ParameterToString(t, "multi")) + } + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // ListSyntheticsTestVersionsOptionalParameters holds optional parameters for ListSyntheticsTestVersions. type ListSyntheticsTestVersionsOptionalParameters struct { LastVersionNumber *int64 @@ -1679,6 +2258,85 @@ func (a *SyntheticsApi) PatchTestSuite(ctx _context.Context, publicId string, bo return localVarReturnValue, localVarHTTPResponse, nil } +// PollSyntheticsTestResults Poll for test results. +// Poll for test results given a list of result IDs. This is typically used after +// triggering tests with CI/CD to retrieve results once they are available. +func (a *SyntheticsApi) PollSyntheticsTestResults(ctx _context.Context, resultIds string) (SyntheticsPollTestResultsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue SyntheticsPollTestResultsResponse + ) + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SyntheticsApi.PollSyntheticsTestResults") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/synthetics/tests/poll_results" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarQueryParams.Add("result_ids", datadog.ParameterToString(resultIds, "")) + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // SearchSuitesOptionalParameters holds optional parameters for SearchSuites. type SearchSuitesOptionalParameters struct { Query *string diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index 27d853a4fc0..541c18d862c 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -924,16 +924,21 @@ // - [SyntheticsApi.GetApiMultistepSubtestParents] // - [SyntheticsApi.GetApiMultistepSubtests] // - [SyntheticsApi.GetOnDemandConcurrencyCap] +// - [SyntheticsApi.GetSyntheticsBrowserTestResult] // - [SyntheticsApi.GetSyntheticsFastTestResult] // - [SyntheticsApi.GetSyntheticsNetworkTest] // - [SyntheticsApi.GetSyntheticsSuite] +// - [SyntheticsApi.GetSyntheticsTestResult] // - [SyntheticsApi.GetSyntheticsTestVersion] // - [SyntheticsApi.GetTestFileDownloadUrl] // - [SyntheticsApi.GetTestFileMultipartPresignedUrls] // - [SyntheticsApi.GetTestParentSuites] +// - [SyntheticsApi.ListSyntheticsBrowserTestLatestResults] +// - [SyntheticsApi.ListSyntheticsTestLatestResults] // - [SyntheticsApi.ListSyntheticsTestVersions] // - [SyntheticsApi.PatchGlobalVariable] // - [SyntheticsApi.PatchTestSuite] +// - [SyntheticsApi.PollSyntheticsTestResults] // - [SyntheticsApi.SearchSuites] // - [SyntheticsApi.SetOnDemandConcurrencyCap] // - [SyntheticsApi.UpdateSyntheticsNetworkTest] diff --git a/api/datadogV2/model_synthetics_fast_test_result_attributes.go b/api/datadogV2/model_synthetics_fast_test_result_attributes.go index cb9d7f304fb..45900bb9b11 100644 --- a/api/datadogV2/model_synthetics_fast_test_result_attributes.go +++ b/api/datadogV2/model_synthetics_fast_test_result_attributes.go @@ -10,17 +10,17 @@ import ( // SyntheticsFastTestResultAttributes Attributes of the fast test result. type SyntheticsFastTestResultAttributes struct { - // Device information for browser-based fast tests. - Device *SyntheticsFastTestResultDevice `json:"device,omitempty"` - // Location from which the fast test was executed. - Location *SyntheticsFastTestResultLocation `json:"location,omitempty"` + // Device information for the test result (browser and mobile tests). + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + // Location information for a Synthetic test result. + Location *SyntheticsTestResultLocation `json:"location,omitempty"` // Detailed result data for the fast test run. The exact shape of nested fields // (`request`, `response`, `assertions`, etc.) depends on the test subtype. Result *SyntheticsFastTestResultDetail `json:"result,omitempty"` // Subtype of the Synthetic test that produced this result. TestSubType *SyntheticsFastTestSubType `json:"test_sub_type,omitempty"` - // The type of the Synthetic test that produced this result (for example, `api` or `browser`). - TestType *string `json:"test_type,omitempty"` + // Type of the Synthetic fast test that produced this result. + TestType *SyntheticsFastTestType `json:"test_type,omitempty"` // Version of the test at the time the fast test was triggered. TestVersion *int64 `json:"test_version,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct @@ -46,9 +46,9 @@ func NewSyntheticsFastTestResultAttributesWithDefaults() *SyntheticsFastTestResu } // GetDevice returns the Device field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultAttributes) GetDevice() SyntheticsFastTestResultDevice { +func (o *SyntheticsFastTestResultAttributes) GetDevice() SyntheticsTestResultDevice { if o == nil || o.Device == nil { - var ret SyntheticsFastTestResultDevice + var ret SyntheticsTestResultDevice return ret } return *o.Device @@ -56,7 +56,7 @@ func (o *SyntheticsFastTestResultAttributes) GetDevice() SyntheticsFastTestResul // GetDeviceOk returns a tuple with the Device field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultAttributes) GetDeviceOk() (*SyntheticsFastTestResultDevice, bool) { +func (o *SyntheticsFastTestResultAttributes) GetDeviceOk() (*SyntheticsTestResultDevice, bool) { if o == nil || o.Device == nil { return nil, false } @@ -68,15 +68,15 @@ func (o *SyntheticsFastTestResultAttributes) HasDevice() bool { return o != nil && o.Device != nil } -// SetDevice gets a reference to the given SyntheticsFastTestResultDevice and assigns it to the Device field. -func (o *SyntheticsFastTestResultAttributes) SetDevice(v SyntheticsFastTestResultDevice) { +// SetDevice gets a reference to the given SyntheticsTestResultDevice and assigns it to the Device field. +func (o *SyntheticsFastTestResultAttributes) SetDevice(v SyntheticsTestResultDevice) { o.Device = &v } // GetLocation returns the Location field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultAttributes) GetLocation() SyntheticsFastTestResultLocation { +func (o *SyntheticsFastTestResultAttributes) GetLocation() SyntheticsTestResultLocation { if o == nil || o.Location == nil { - var ret SyntheticsFastTestResultLocation + var ret SyntheticsTestResultLocation return ret } return *o.Location @@ -84,7 +84,7 @@ func (o *SyntheticsFastTestResultAttributes) GetLocation() SyntheticsFastTestRes // GetLocationOk returns a tuple with the Location field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultAttributes) GetLocationOk() (*SyntheticsFastTestResultLocation, bool) { +func (o *SyntheticsFastTestResultAttributes) GetLocationOk() (*SyntheticsTestResultLocation, bool) { if o == nil || o.Location == nil { return nil, false } @@ -96,8 +96,8 @@ func (o *SyntheticsFastTestResultAttributes) HasLocation() bool { return o != nil && o.Location != nil } -// SetLocation gets a reference to the given SyntheticsFastTestResultLocation and assigns it to the Location field. -func (o *SyntheticsFastTestResultAttributes) SetLocation(v SyntheticsFastTestResultLocation) { +// SetLocation gets a reference to the given SyntheticsTestResultLocation and assigns it to the Location field. +func (o *SyntheticsFastTestResultAttributes) SetLocation(v SyntheticsTestResultLocation) { o.Location = &v } @@ -158,9 +158,9 @@ func (o *SyntheticsFastTestResultAttributes) SetTestSubType(v SyntheticsFastTest } // GetTestType returns the TestType field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultAttributes) GetTestType() string { +func (o *SyntheticsFastTestResultAttributes) GetTestType() SyntheticsFastTestType { if o == nil || o.TestType == nil { - var ret string + var ret SyntheticsFastTestType return ret } return *o.TestType @@ -168,7 +168,7 @@ func (o *SyntheticsFastTestResultAttributes) GetTestType() string { // GetTestTypeOk returns a tuple with the TestType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultAttributes) GetTestTypeOk() (*string, bool) { +func (o *SyntheticsFastTestResultAttributes) GetTestTypeOk() (*SyntheticsFastTestType, bool) { if o == nil || o.TestType == nil { return nil, false } @@ -180,8 +180,8 @@ func (o *SyntheticsFastTestResultAttributes) HasTestType() bool { return o != nil && o.TestType != nil } -// SetTestType gets a reference to the given string and assigns it to the TestType field. -func (o *SyntheticsFastTestResultAttributes) SetTestType(v string) { +// SetTestType gets a reference to the given SyntheticsFastTestType and assigns it to the TestType field. +func (o *SyntheticsFastTestResultAttributes) SetTestType(v SyntheticsFastTestType) { o.TestType = &v } @@ -247,12 +247,12 @@ func (o SyntheticsFastTestResultAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *SyntheticsFastTestResultAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Device *SyntheticsFastTestResultDevice `json:"device,omitempty"` - Location *SyntheticsFastTestResultLocation `json:"location,omitempty"` - Result *SyntheticsFastTestResultDetail `json:"result,omitempty"` - TestSubType *SyntheticsFastTestSubType `json:"test_sub_type,omitempty"` - TestType *string `json:"test_type,omitempty"` - TestVersion *int64 `json:"test_version,omitempty"` + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + Location *SyntheticsTestResultLocation `json:"location,omitempty"` + Result *SyntheticsFastTestResultDetail `json:"result,omitempty"` + TestSubType *SyntheticsFastTestSubType `json:"test_sub_type,omitempty"` + TestType *SyntheticsFastTestType `json:"test_type,omitempty"` + TestVersion *int64 `json:"test_version,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -282,7 +282,11 @@ func (o *SyntheticsFastTestResultAttributes) UnmarshalJSON(bytes []byte) (err er } else { o.TestSubType = all.TestSubType } - o.TestType = all.TestType + if all.TestType != nil && !all.TestType.IsValid() { + hasInvalidField = true + } else { + o.TestType = all.TestType + } o.TestVersion = all.TestVersion if len(additionalProperties) > 0 { diff --git a/api/datadogV2/model_synthetics_fast_test_result_detail.go b/api/datadogV2/model_synthetics_fast_test_result_detail.go index d4a03d3d37a..8f3f97e625f 100644 --- a/api/datadogV2/model_synthetics_fast_test_result_detail.go +++ b/api/datadogV2/model_synthetics_fast_test_result_detail.go @@ -12,39 +12,39 @@ import ( // (`request`, `response`, `assertions`, etc.) depends on the test subtype. type SyntheticsFastTestResultDetail struct { // Results of each assertion evaluated during the test. - Assertions []map[string]interface{} `json:"assertions,omitempty"` + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` // gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). CallType *string `json:"call_type,omitempty"` - // TLS certificate details, present for SSL tests. - Cert map[string]interface{} `json:"cert,omitempty"` + // SSL/TLS certificate information returned from an SSL test. + Cert *SyntheticsTestResultCertificate `json:"cert,omitempty"` // Total duration of the test in milliseconds. Duration *float64 `json:"duration,omitempty"` - // Failure details if the fast test did not pass. - Failure *SyntheticsFastTestResultFailure `json:"failure,omitempty"` + // Details about the failure of a Synthetic test. + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` // Unix timestamp (ms) of when the test finished. FinishedAt *int64 `json:"finished_at,omitempty"` // The result ID. Set to the fast test UUID because no persistent result ID exists for fast tests. Id *string `json:"id,omitempty"` // Whether this result is from an automatic fast retry. IsFastRetry *bool `json:"is_fast_retry,omitempty"` - // Details of the outgoing request made during the test. - Request map[string]interface{} `json:"request,omitempty"` + // Details of the outgoing request made during the test execution. + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` // IP address resolved for the target host. ResolvedIp *string `json:"resolved_ip,omitempty"` - // Details of the response received during the test. - Response map[string]interface{} `json:"response,omitempty"` - // Run type indicating how this test was triggered (for example, `fast`). - RunType *string `json:"run_type,omitempty"` + // Details of the response received during the test execution. + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + // The type of run for a Synthetic test result. + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` // Unix timestamp (ms) of when the test started. StartedAt *int64 `json:"started_at,omitempty"` // Status of the test result (`passed` or `failed`). Status *string `json:"status,omitempty"` // Step results for multistep API tests. - Steps []map[string]interface{} `json:"steps,omitempty"` + Steps []SyntheticsTestResultStep `json:"steps,omitempty"` // Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). Timings map[string]interface{} `json:"timings,omitempty"` // Traceroute hop results, present for ICMP and TCP tests. - Traceroute []map[string]interface{} `json:"traceroute,omitempty"` + Traceroute []SyntheticsTestResultTracerouteHop `json:"traceroute,omitempty"` // Unix timestamp (ms) of when the test was triggered. TriggeredAt *int64 `json:"triggered_at,omitempty"` // Whether the test was run through a Synthetics tunnel. @@ -72,9 +72,9 @@ func NewSyntheticsFastTestResultDetailWithDefaults() *SyntheticsFastTestResultDe } // GetAssertions returns the Assertions field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetAssertions() []map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetAssertions() []SyntheticsTestResultAssertionResult { if o == nil || o.Assertions == nil { - var ret []map[string]interface{} + var ret []SyntheticsTestResultAssertionResult return ret } return o.Assertions @@ -82,7 +82,7 @@ func (o *SyntheticsFastTestResultDetail) GetAssertions() []map[string]interface{ // GetAssertionsOk returns a tuple with the Assertions field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetAssertionsOk() (*[]map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetAssertionsOk() (*[]SyntheticsTestResultAssertionResult, bool) { if o == nil || o.Assertions == nil { return nil, false } @@ -94,8 +94,8 @@ func (o *SyntheticsFastTestResultDetail) HasAssertions() bool { return o != nil && o.Assertions != nil } -// SetAssertions gets a reference to the given []map[string]interface{} and assigns it to the Assertions field. -func (o *SyntheticsFastTestResultDetail) SetAssertions(v []map[string]interface{}) { +// SetAssertions gets a reference to the given []SyntheticsTestResultAssertionResult and assigns it to the Assertions field. +func (o *SyntheticsFastTestResultDetail) SetAssertions(v []SyntheticsTestResultAssertionResult) { o.Assertions = v } @@ -128,21 +128,21 @@ func (o *SyntheticsFastTestResultDetail) SetCallType(v string) { } // GetCert returns the Cert field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetCert() map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetCert() SyntheticsTestResultCertificate { if o == nil || o.Cert == nil { - var ret map[string]interface{} + var ret SyntheticsTestResultCertificate return ret } - return o.Cert + return *o.Cert } // GetCertOk returns a tuple with the Cert field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetCertOk() (*map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetCertOk() (*SyntheticsTestResultCertificate, bool) { if o == nil || o.Cert == nil { return nil, false } - return &o.Cert, true + return o.Cert, true } // HasCert returns a boolean if a field has been set. @@ -150,9 +150,9 @@ func (o *SyntheticsFastTestResultDetail) HasCert() bool { return o != nil && o.Cert != nil } -// SetCert gets a reference to the given map[string]interface{} and assigns it to the Cert field. -func (o *SyntheticsFastTestResultDetail) SetCert(v map[string]interface{}) { - o.Cert = v +// SetCert gets a reference to the given SyntheticsTestResultCertificate and assigns it to the Cert field. +func (o *SyntheticsFastTestResultDetail) SetCert(v SyntheticsTestResultCertificate) { + o.Cert = &v } // GetDuration returns the Duration field value if set, zero value otherwise. @@ -184,9 +184,9 @@ func (o *SyntheticsFastTestResultDetail) SetDuration(v float64) { } // GetFailure returns the Failure field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetFailure() SyntheticsFastTestResultFailure { +func (o *SyntheticsFastTestResultDetail) GetFailure() SyntheticsTestResultFailure { if o == nil || o.Failure == nil { - var ret SyntheticsFastTestResultFailure + var ret SyntheticsTestResultFailure return ret } return *o.Failure @@ -194,7 +194,7 @@ func (o *SyntheticsFastTestResultDetail) GetFailure() SyntheticsFastTestResultFa // GetFailureOk returns a tuple with the Failure field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetFailureOk() (*SyntheticsFastTestResultFailure, bool) { +func (o *SyntheticsFastTestResultDetail) GetFailureOk() (*SyntheticsTestResultFailure, bool) { if o == nil || o.Failure == nil { return nil, false } @@ -206,8 +206,8 @@ func (o *SyntheticsFastTestResultDetail) HasFailure() bool { return o != nil && o.Failure != nil } -// SetFailure gets a reference to the given SyntheticsFastTestResultFailure and assigns it to the Failure field. -func (o *SyntheticsFastTestResultDetail) SetFailure(v SyntheticsFastTestResultFailure) { +// SetFailure gets a reference to the given SyntheticsTestResultFailure and assigns it to the Failure field. +func (o *SyntheticsFastTestResultDetail) SetFailure(v SyntheticsTestResultFailure) { o.Failure = &v } @@ -296,21 +296,21 @@ func (o *SyntheticsFastTestResultDetail) SetIsFastRetry(v bool) { } // GetRequest returns the Request field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetRequest() map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetRequest() SyntheticsTestResultRequestInfo { if o == nil || o.Request == nil { - var ret map[string]interface{} + var ret SyntheticsTestResultRequestInfo return ret } - return o.Request + return *o.Request } // GetRequestOk returns a tuple with the Request field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetRequestOk() (*map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetRequestOk() (*SyntheticsTestResultRequestInfo, bool) { if o == nil || o.Request == nil { return nil, false } - return &o.Request, true + return o.Request, true } // HasRequest returns a boolean if a field has been set. @@ -318,9 +318,9 @@ func (o *SyntheticsFastTestResultDetail) HasRequest() bool { return o != nil && o.Request != nil } -// SetRequest gets a reference to the given map[string]interface{} and assigns it to the Request field. -func (o *SyntheticsFastTestResultDetail) SetRequest(v map[string]interface{}) { - o.Request = v +// SetRequest gets a reference to the given SyntheticsTestResultRequestInfo and assigns it to the Request field. +func (o *SyntheticsFastTestResultDetail) SetRequest(v SyntheticsTestResultRequestInfo) { + o.Request = &v } // GetResolvedIp returns the ResolvedIp field value if set, zero value otherwise. @@ -352,21 +352,21 @@ func (o *SyntheticsFastTestResultDetail) SetResolvedIp(v string) { } // GetResponse returns the Response field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetResponse() map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetResponse() SyntheticsTestResultResponseInfo { if o == nil || o.Response == nil { - var ret map[string]interface{} + var ret SyntheticsTestResultResponseInfo return ret } - return o.Response + return *o.Response } // GetResponseOk returns a tuple with the Response field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetResponseOk() (*map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetResponseOk() (*SyntheticsTestResultResponseInfo, bool) { if o == nil || o.Response == nil { return nil, false } - return &o.Response, true + return o.Response, true } // HasResponse returns a boolean if a field has been set. @@ -374,15 +374,15 @@ func (o *SyntheticsFastTestResultDetail) HasResponse() bool { return o != nil && o.Response != nil } -// SetResponse gets a reference to the given map[string]interface{} and assigns it to the Response field. -func (o *SyntheticsFastTestResultDetail) SetResponse(v map[string]interface{}) { - o.Response = v +// SetResponse gets a reference to the given SyntheticsTestResultResponseInfo and assigns it to the Response field. +func (o *SyntheticsFastTestResultDetail) SetResponse(v SyntheticsTestResultResponseInfo) { + o.Response = &v } // GetRunType returns the RunType field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetRunType() string { +func (o *SyntheticsFastTestResultDetail) GetRunType() SyntheticsTestResultRunType { if o == nil || o.RunType == nil { - var ret string + var ret SyntheticsTestResultRunType return ret } return *o.RunType @@ -390,7 +390,7 @@ func (o *SyntheticsFastTestResultDetail) GetRunType() string { // GetRunTypeOk returns a tuple with the RunType field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetRunTypeOk() (*string, bool) { +func (o *SyntheticsFastTestResultDetail) GetRunTypeOk() (*SyntheticsTestResultRunType, bool) { if o == nil || o.RunType == nil { return nil, false } @@ -402,8 +402,8 @@ func (o *SyntheticsFastTestResultDetail) HasRunType() bool { return o != nil && o.RunType != nil } -// SetRunType gets a reference to the given string and assigns it to the RunType field. -func (o *SyntheticsFastTestResultDetail) SetRunType(v string) { +// SetRunType gets a reference to the given SyntheticsTestResultRunType and assigns it to the RunType field. +func (o *SyntheticsFastTestResultDetail) SetRunType(v SyntheticsTestResultRunType) { o.RunType = &v } @@ -464,9 +464,9 @@ func (o *SyntheticsFastTestResultDetail) SetStatus(v string) { } // GetSteps returns the Steps field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetSteps() []map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetSteps() []SyntheticsTestResultStep { if o == nil || o.Steps == nil { - var ret []map[string]interface{} + var ret []SyntheticsTestResultStep return ret } return o.Steps @@ -474,7 +474,7 @@ func (o *SyntheticsFastTestResultDetail) GetSteps() []map[string]interface{} { // GetStepsOk returns a tuple with the Steps field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetStepsOk() (*[]map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetStepsOk() (*[]SyntheticsTestResultStep, bool) { if o == nil || o.Steps == nil { return nil, false } @@ -486,8 +486,8 @@ func (o *SyntheticsFastTestResultDetail) HasSteps() bool { return o != nil && o.Steps != nil } -// SetSteps gets a reference to the given []map[string]interface{} and assigns it to the Steps field. -func (o *SyntheticsFastTestResultDetail) SetSteps(v []map[string]interface{}) { +// SetSteps gets a reference to the given []SyntheticsTestResultStep and assigns it to the Steps field. +func (o *SyntheticsFastTestResultDetail) SetSteps(v []SyntheticsTestResultStep) { o.Steps = v } @@ -520,9 +520,9 @@ func (o *SyntheticsFastTestResultDetail) SetTimings(v map[string]interface{}) { } // GetTraceroute returns the Traceroute field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDetail) GetTraceroute() []map[string]interface{} { +func (o *SyntheticsFastTestResultDetail) GetTraceroute() []SyntheticsTestResultTracerouteHop { if o == nil || o.Traceroute == nil { - var ret []map[string]interface{} + var ret []SyntheticsTestResultTracerouteHop return ret } return o.Traceroute @@ -530,7 +530,7 @@ func (o *SyntheticsFastTestResultDetail) GetTraceroute() []map[string]interface{ // GetTracerouteOk returns a tuple with the Traceroute field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDetail) GetTracerouteOk() (*[]map[string]interface{}, bool) { +func (o *SyntheticsFastTestResultDetail) GetTracerouteOk() (*[]SyntheticsTestResultTracerouteHop, bool) { if o == nil || o.Traceroute == nil { return nil, false } @@ -542,8 +542,8 @@ func (o *SyntheticsFastTestResultDetail) HasTraceroute() bool { return o != nil && o.Traceroute != nil } -// SetTraceroute gets a reference to the given []map[string]interface{} and assigns it to the Traceroute field. -func (o *SyntheticsFastTestResultDetail) SetTraceroute(v []map[string]interface{}) { +// SetTraceroute gets a reference to the given []SyntheticsTestResultTracerouteHop and assigns it to the Traceroute field. +func (o *SyntheticsFastTestResultDetail) SetTraceroute(v []SyntheticsTestResultTracerouteHop) { o.Traceroute = v } @@ -676,25 +676,25 @@ func (o SyntheticsFastTestResultDetail) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *SyntheticsFastTestResultDetail) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Assertions []map[string]interface{} `json:"assertions,omitempty"` - CallType *string `json:"call_type,omitempty"` - Cert map[string]interface{} `json:"cert,omitempty"` - Duration *float64 `json:"duration,omitempty"` - Failure *SyntheticsFastTestResultFailure `json:"failure,omitempty"` - FinishedAt *int64 `json:"finished_at,omitempty"` - Id *string `json:"id,omitempty"` - IsFastRetry *bool `json:"is_fast_retry,omitempty"` - Request map[string]interface{} `json:"request,omitempty"` - ResolvedIp *string `json:"resolved_ip,omitempty"` - Response map[string]interface{} `json:"response,omitempty"` - RunType *string `json:"run_type,omitempty"` - StartedAt *int64 `json:"started_at,omitempty"` - Status *string `json:"status,omitempty"` - Steps []map[string]interface{} `json:"steps,omitempty"` - Timings map[string]interface{} `json:"timings,omitempty"` - Traceroute []map[string]interface{} `json:"traceroute,omitempty"` - TriggeredAt *int64 `json:"triggered_at,omitempty"` - Tunnel *bool `json:"tunnel,omitempty"` + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` + CallType *string `json:"call_type,omitempty"` + Cert *SyntheticsTestResultCertificate `json:"cert,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` + FinishedAt *int64 `json:"finished_at,omitempty"` + Id *string `json:"id,omitempty"` + IsFastRetry *bool `json:"is_fast_retry,omitempty"` + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + ResolvedIp *string `json:"resolved_ip,omitempty"` + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` + StartedAt *int64 `json:"started_at,omitempty"` + Status *string `json:"status,omitempty"` + Steps []SyntheticsTestResultStep `json:"steps,omitempty"` + Timings map[string]interface{} `json:"timings,omitempty"` + Traceroute []SyntheticsTestResultTracerouteHop `json:"traceroute,omitempty"` + TriggeredAt *int64 `json:"triggered_at,omitempty"` + Tunnel *bool `json:"tunnel,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) @@ -709,6 +709,9 @@ func (o *SyntheticsFastTestResultDetail) UnmarshalJSON(bytes []byte) (err error) hasInvalidField := false o.Assertions = all.Assertions o.CallType = all.CallType + if all.Cert != nil && all.Cert.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } o.Cert = all.Cert o.Duration = all.Duration if all.Failure != nil && all.Failure.UnparsedObject != nil && o.UnparsedObject == nil { @@ -718,10 +721,20 @@ func (o *SyntheticsFastTestResultDetail) UnmarshalJSON(bytes []byte) (err error) o.FinishedAt = all.FinishedAt o.Id = all.Id o.IsFastRetry = all.IsFastRetry + if all.Request != nil && all.Request.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } o.Request = all.Request o.ResolvedIp = all.ResolvedIp + if all.Response != nil && all.Response.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } o.Response = all.Response - o.RunType = all.RunType + if all.RunType != nil && !all.RunType.IsValid() { + hasInvalidField = true + } else { + o.RunType = all.RunType + } o.StartedAt = all.StartedAt o.Status = all.Status o.Steps = all.Steps diff --git a/api/datadogV2/model_synthetics_fast_test_result_failure.go b/api/datadogV2/model_synthetics_fast_test_result_failure.go deleted file mode 100644 index d42f2018714..00000000000 --- a/api/datadogV2/model_synthetics_fast_test_result_failure.go +++ /dev/null @@ -1,137 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. - -package datadogV2 - -import ( - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" -) - -// SyntheticsFastTestResultFailure Failure details if the fast test did not pass. -type SyntheticsFastTestResultFailure struct { - // Error code identifying the failure type. - Code *string `json:"code,omitempty"` - // Human-readable description of the failure. - Message *string `json:"message,omitempty"` - // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct - UnparsedObject map[string]interface{} `json:"-"` - AdditionalProperties map[string]interface{} `json:"-"` -} - -// NewSyntheticsFastTestResultFailure instantiates a new SyntheticsFastTestResultFailure object. -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed. -func NewSyntheticsFastTestResultFailure() *SyntheticsFastTestResultFailure { - this := SyntheticsFastTestResultFailure{} - return &this -} - -// NewSyntheticsFastTestResultFailureWithDefaults instantiates a new SyntheticsFastTestResultFailure object. -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set. -func NewSyntheticsFastTestResultFailureWithDefaults() *SyntheticsFastTestResultFailure { - this := SyntheticsFastTestResultFailure{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultFailure) GetCode() string { - if o == nil || o.Code == nil { - var ret string - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultFailure) GetCodeOk() (*string, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultFailure) HasCode() bool { - return o != nil && o.Code != nil -} - -// SetCode gets a reference to the given string and assigns it to the Code field. -func (o *SyntheticsFastTestResultFailure) SetCode(v string) { - o.Code = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultFailure) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultFailure) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultFailure) HasMessage() bool { - return o != nil && o.Message != nil -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *SyntheticsFastTestResultFailure) SetMessage(v string) { - o.Message = &v -} - -// MarshalJSON serializes the struct using spec logic. -func (o SyntheticsFastTestResultFailure) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.UnparsedObject != nil { - return datadog.Marshal(o.UnparsedObject) - } - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - return datadog.Marshal(toSerialize) -} - -// UnmarshalJSON deserializes the given payload. -func (o *SyntheticsFastTestResultFailure) UnmarshalJSON(bytes []byte) (err error) { - all := struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - }{} - if err = datadog.Unmarshal(bytes, &all); err != nil { - return datadog.Unmarshal(bytes, &o.UnparsedObject) - } - additionalProperties := make(map[string]interface{}) - if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"code", "message"}) - } else { - return err - } - o.Code = all.Code - o.Message = all.Message - - if len(additionalProperties) > 0 { - o.AdditionalProperties = additionalProperties - } - - return nil -} diff --git a/api/datadogV2/model_synthetics_fast_test_type.go b/api/datadogV2/model_synthetics_fast_test_type.go new file mode 100644 index 00000000000..d8b3dee3568 --- /dev/null +++ b/api/datadogV2/model_synthetics_fast_test_type.go @@ -0,0 +1,66 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsFastTestType Type of the Synthetic fast test that produced this result. +type SyntheticsFastTestType string + +// List of SyntheticsFastTestType. +const ( + SYNTHETICSFASTTESTTYPE_FAST_API SyntheticsFastTestType = "fast-api" + SYNTHETICSFASTTESTTYPE_FAST_BROWSER SyntheticsFastTestType = "fast-browser" +) + +var allowedSyntheticsFastTestTypeEnumValues = []SyntheticsFastTestType{ + SYNTHETICSFASTTESTTYPE_FAST_API, + SYNTHETICSFASTTESTTYPE_FAST_BROWSER, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsFastTestType) GetAllowedValues() []SyntheticsFastTestType { + return allowedSyntheticsFastTestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsFastTestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsFastTestType(value) + return nil +} + +// NewSyntheticsFastTestTypeFromValue returns a pointer to a valid SyntheticsFastTestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsFastTestTypeFromValue(v string) (*SyntheticsFastTestType, error) { + ev := SyntheticsFastTestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsFastTestType: valid values are %v", v, allowedSyntheticsFastTestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsFastTestType) IsValid() bool { + for _, existing := range allowedSyntheticsFastTestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsFastTestType value. +func (v SyntheticsFastTestType) Ptr() *SyntheticsFastTestType { + return &v +} diff --git a/api/datadogV2/model_synthetics_poll_test_results_response.go b/api/datadogV2/model_synthetics_poll_test_results_response.go new file mode 100644 index 00000000000..12655cd2738 --- /dev/null +++ b/api/datadogV2/model_synthetics_poll_test_results_response.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsPollTestResultsResponse Response object for polling Synthetic test results. +type SyntheticsPollTestResultsResponse struct { + // Array of Synthetic test results. + Data []SyntheticsTestResultData `json:"data,omitempty"` + // Array of included related resources, such as the test definition. + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsPollTestResultsResponse instantiates a new SyntheticsPollTestResultsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsPollTestResultsResponse() *SyntheticsPollTestResultsResponse { + this := SyntheticsPollTestResultsResponse{} + return &this +} + +// NewSyntheticsPollTestResultsResponseWithDefaults instantiates a new SyntheticsPollTestResultsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsPollTestResultsResponseWithDefaults() *SyntheticsPollTestResultsResponse { + this := SyntheticsPollTestResultsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SyntheticsPollTestResultsResponse) GetData() []SyntheticsTestResultData { + if o == nil || o.Data == nil { + var ret []SyntheticsTestResultData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsPollTestResultsResponse) GetDataOk() (*[]SyntheticsTestResultData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SyntheticsPollTestResultsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []SyntheticsTestResultData and assigns it to the Data field. +func (o *SyntheticsPollTestResultsResponse) SetData(v []SyntheticsTestResultData) { + o.Data = v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *SyntheticsPollTestResultsResponse) GetIncluded() []SyntheticsTestResultIncludedItem { + if o == nil || o.Included == nil { + var ret []SyntheticsTestResultIncludedItem + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsPollTestResultsResponse) GetIncludedOk() (*[]SyntheticsTestResultIncludedItem, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *SyntheticsPollTestResultsResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []SyntheticsTestResultIncludedItem and assigns it to the Included field. +func (o *SyntheticsPollTestResultsResponse) SetIncluded(v []SyntheticsTestResultIncludedItem) { + o.Included = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsPollTestResultsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsPollTestResultsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []SyntheticsTestResultData `json:"data,omitempty"` + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included"}) + } else { + return err + } + o.Data = all.Data + o.Included = all.Included + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_latest_results_response.go b/api/datadogV2/model_synthetics_test_latest_results_response.go new file mode 100644 index 00000000000..93b8daf2c41 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_latest_results_response.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestLatestResultsResponse Response object for a Synthetic test's latest result summaries. +type SyntheticsTestLatestResultsResponse struct { + // Array of Synthetic test result summaries. + Data []SyntheticsTestResultSummaryData `json:"data,omitempty"` + // Array of included related resources, such as the test definition. + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestLatestResultsResponse instantiates a new SyntheticsTestLatestResultsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestLatestResultsResponse() *SyntheticsTestLatestResultsResponse { + this := SyntheticsTestLatestResultsResponse{} + return &this +} + +// NewSyntheticsTestLatestResultsResponseWithDefaults instantiates a new SyntheticsTestLatestResultsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestLatestResultsResponseWithDefaults() *SyntheticsTestLatestResultsResponse { + this := SyntheticsTestLatestResultsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SyntheticsTestLatestResultsResponse) GetData() []SyntheticsTestResultSummaryData { + if o == nil || o.Data == nil { + var ret []SyntheticsTestResultSummaryData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestLatestResultsResponse) GetDataOk() (*[]SyntheticsTestResultSummaryData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SyntheticsTestLatestResultsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []SyntheticsTestResultSummaryData and assigns it to the Data field. +func (o *SyntheticsTestLatestResultsResponse) SetData(v []SyntheticsTestResultSummaryData) { + o.Data = v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *SyntheticsTestLatestResultsResponse) GetIncluded() []SyntheticsTestResultIncludedItem { + if o == nil || o.Included == nil { + var ret []SyntheticsTestResultIncludedItem + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestLatestResultsResponse) GetIncludedOk() (*[]SyntheticsTestResultIncludedItem, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *SyntheticsTestLatestResultsResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []SyntheticsTestResultIncludedItem and assigns it to the Included field. +func (o *SyntheticsTestLatestResultsResponse) SetIncluded(v []SyntheticsTestResultIncludedItem) { + o.Included = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestLatestResultsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestLatestResultsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []SyntheticsTestResultSummaryData `json:"data,omitempty"` + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included"}) + } else { + return err + } + o.Data = all.Data + o.Included = all.Included + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_assertion_result.go b/api/datadogV2/model_synthetics_test_result_assertion_result.go new file mode 100644 index 00000000000..5ca950e08fe --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_assertion_result.go @@ -0,0 +1,417 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultAssertionResult An individual assertion result from a Synthetic test. +type SyntheticsTestResultAssertionResult struct { + // Actual value observed during the test. Its type depends on the assertion type. + Actual interface{} `json:"actual,omitempty"` + // Error message if the assertion failed. + ErrorMessage *string `json:"error_message,omitempty"` + // Expected value for the assertion. Its type depends on the assertion type. + Expected interface{} `json:"expected,omitempty"` + // Operator used for the assertion (for example, `is`, `contains`). + Operator *string `json:"operator,omitempty"` + // Property targeted by the assertion, when applicable. + Property *string `json:"property,omitempty"` + // Target value for the assertion. Its type depends on the assertion type. + Target interface{} `json:"target,omitempty"` + // JSON path or XPath evaluated for the assertion. + TargetPath *string `json:"target_path,omitempty"` + // Operator used for the target path assertion. + TargetPathOperator *string `json:"target_path_operator,omitempty"` + // Type of the assertion (for example, `responseTime`, `statusCode`, `body`). + Type *string `json:"type,omitempty"` + // Whether the assertion passed. + Valid *bool `json:"valid,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultAssertionResult instantiates a new SyntheticsTestResultAssertionResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultAssertionResult() *SyntheticsTestResultAssertionResult { + this := SyntheticsTestResultAssertionResult{} + return &this +} + +// NewSyntheticsTestResultAssertionResultWithDefaults instantiates a new SyntheticsTestResultAssertionResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultAssertionResultWithDefaults() *SyntheticsTestResultAssertionResult { + this := SyntheticsTestResultAssertionResult{} + return &this +} + +// GetActual returns the Actual field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetActual() interface{} { + if o == nil || o.Actual == nil { + var ret interface{} + return ret + } + return o.Actual +} + +// GetActualOk returns a tuple with the Actual field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetActualOk() (*interface{}, bool) { + if o == nil || o.Actual == nil { + return nil, false + } + return &o.Actual, true +} + +// HasActual returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasActual() bool { + return o != nil && o.Actual != nil +} + +// SetActual gets a reference to the given interface{} and assigns it to the Actual field. +func (o *SyntheticsTestResultAssertionResult) SetActual(v interface{}) { + o.Actual = v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasErrorMessage() bool { + return o != nil && o.ErrorMessage != nil +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *SyntheticsTestResultAssertionResult) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetExpected returns the Expected field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetExpected() interface{} { + if o == nil || o.Expected == nil { + var ret interface{} + return ret + } + return o.Expected +} + +// GetExpectedOk returns a tuple with the Expected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetExpectedOk() (*interface{}, bool) { + if o == nil || o.Expected == nil { + return nil, false + } + return &o.Expected, true +} + +// HasExpected returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasExpected() bool { + return o != nil && o.Expected != nil +} + +// SetExpected gets a reference to the given interface{} and assigns it to the Expected field. +func (o *SyntheticsTestResultAssertionResult) SetExpected(v interface{}) { + o.Expected = v +} + +// GetOperator returns the Operator field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetOperator() string { + if o == nil || o.Operator == nil { + var ret string + return ret + } + return *o.Operator +} + +// GetOperatorOk returns a tuple with the Operator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetOperatorOk() (*string, bool) { + if o == nil || o.Operator == nil { + return nil, false + } + return o.Operator, true +} + +// HasOperator returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasOperator() bool { + return o != nil && o.Operator != nil +} + +// SetOperator gets a reference to the given string and assigns it to the Operator field. +func (o *SyntheticsTestResultAssertionResult) SetOperator(v string) { + o.Operator = &v +} + +// GetProperty returns the Property field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetPropertyOk() (*string, bool) { + if o == nil || o.Property == nil { + return nil, false + } + return o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasProperty() bool { + return o != nil && o.Property != nil +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *SyntheticsTestResultAssertionResult) SetProperty(v string) { + o.Property = &v +} + +// GetTarget returns the Target field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetTarget() interface{} { + if o == nil || o.Target == nil { + var ret interface{} + return ret + } + return o.Target +} + +// GetTargetOk returns a tuple with the Target field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetTargetOk() (*interface{}, bool) { + if o == nil || o.Target == nil { + return nil, false + } + return &o.Target, true +} + +// HasTarget returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasTarget() bool { + return o != nil && o.Target != nil +} + +// SetTarget gets a reference to the given interface{} and assigns it to the Target field. +func (o *SyntheticsTestResultAssertionResult) SetTarget(v interface{}) { + o.Target = v +} + +// GetTargetPath returns the TargetPath field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetTargetPath() string { + if o == nil || o.TargetPath == nil { + var ret string + return ret + } + return *o.TargetPath +} + +// GetTargetPathOk returns a tuple with the TargetPath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetTargetPathOk() (*string, bool) { + if o == nil || o.TargetPath == nil { + return nil, false + } + return o.TargetPath, true +} + +// HasTargetPath returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasTargetPath() bool { + return o != nil && o.TargetPath != nil +} + +// SetTargetPath gets a reference to the given string and assigns it to the TargetPath field. +func (o *SyntheticsTestResultAssertionResult) SetTargetPath(v string) { + o.TargetPath = &v +} + +// GetTargetPathOperator returns the TargetPathOperator field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetTargetPathOperator() string { + if o == nil || o.TargetPathOperator == nil { + var ret string + return ret + } + return *o.TargetPathOperator +} + +// GetTargetPathOperatorOk returns a tuple with the TargetPathOperator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetTargetPathOperatorOk() (*string, bool) { + if o == nil || o.TargetPathOperator == nil { + return nil, false + } + return o.TargetPathOperator, true +} + +// HasTargetPathOperator returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasTargetPathOperator() bool { + return o != nil && o.TargetPathOperator != nil +} + +// SetTargetPathOperator gets a reference to the given string and assigns it to the TargetPathOperator field. +func (o *SyntheticsTestResultAssertionResult) SetTargetPathOperator(v string) { + o.TargetPathOperator = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultAssertionResult) SetType(v string) { + o.Type = &v +} + +// GetValid returns the Valid field value if set, zero value otherwise. +func (o *SyntheticsTestResultAssertionResult) GetValid() bool { + if o == nil || o.Valid == nil { + var ret bool + return ret + } + return *o.Valid +} + +// GetValidOk returns a tuple with the Valid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAssertionResult) GetValidOk() (*bool, bool) { + if o == nil || o.Valid == nil { + return nil, false + } + return o.Valid, true +} + +// HasValid returns a boolean if a field has been set. +func (o *SyntheticsTestResultAssertionResult) HasValid() bool { + return o != nil && o.Valid != nil +} + +// SetValid gets a reference to the given bool and assigns it to the Valid field. +func (o *SyntheticsTestResultAssertionResult) SetValid(v bool) { + o.Valid = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultAssertionResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Actual != nil { + toSerialize["actual"] = o.Actual + } + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.Expected != nil { + toSerialize["expected"] = o.Expected + } + if o.Operator != nil { + toSerialize["operator"] = o.Operator + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Target != nil { + toSerialize["target"] = o.Target + } + if o.TargetPath != nil { + toSerialize["target_path"] = o.TargetPath + } + if o.TargetPathOperator != nil { + toSerialize["target_path_operator"] = o.TargetPathOperator + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Valid != nil { + toSerialize["valid"] = o.Valid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultAssertionResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Actual interface{} `json:"actual,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + Expected interface{} `json:"expected,omitempty"` + Operator *string `json:"operator,omitempty"` + Property *string `json:"property,omitempty"` + Target interface{} `json:"target,omitempty"` + TargetPath *string `json:"target_path,omitempty"` + TargetPathOperator *string `json:"target_path_operator,omitempty"` + Type *string `json:"type,omitempty"` + Valid *bool `json:"valid,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"actual", "error_message", "expected", "operator", "property", "target", "target_path", "target_path_operator", "type", "valid"}) + } else { + return err + } + o.Actual = all.Actual + o.ErrorMessage = all.ErrorMessage + o.Expected = all.Expected + o.Operator = all.Operator + o.Property = all.Property + o.Target = all.Target + o.TargetPath = all.TargetPath + o.TargetPathOperator = all.TargetPathOperator + o.Type = all.Type + o.Valid = all.Valid + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_attributes.go b/api/datadogV2/model_synthetics_test_result_attributes.go new file mode 100644 index 00000000000..a44503727a0 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_attributes.go @@ -0,0 +1,379 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultAttributes Attributes of a Synthetic test result. +type SyntheticsTestResultAttributes struct { + // Batch information for the test result. + Batch *SyntheticsTestResultBatch `json:"batch,omitempty"` + // CI information associated with the test result. + Ci *SyntheticsTestResultCI `json:"ci,omitempty"` + // Device information for the test result (browser and mobile tests). + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + // Git information associated with the test result. + Git *SyntheticsTestResultGit `json:"git,omitempty"` + // Location information for a Synthetic test result. + Location *SyntheticsTestResultLocation `json:"location,omitempty"` + // Full result details for a Synthetic test execution. + Result *SyntheticsTestResultDetail `json:"result,omitempty"` + // Subtype of the Synthetic test that produced this result. + TestSubType *SyntheticsTestSubType `json:"test_sub_type,omitempty"` + // Type of the Synthetic test that produced this result. + TestType *SyntheticsTestType `json:"test_type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultAttributes instantiates a new SyntheticsTestResultAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultAttributes() *SyntheticsTestResultAttributes { + this := SyntheticsTestResultAttributes{} + return &this +} + +// NewSyntheticsTestResultAttributesWithDefaults instantiates a new SyntheticsTestResultAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultAttributesWithDefaults() *SyntheticsTestResultAttributes { + this := SyntheticsTestResultAttributes{} + return &this +} + +// GetBatch returns the Batch field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetBatch() SyntheticsTestResultBatch { + if o == nil || o.Batch == nil { + var ret SyntheticsTestResultBatch + return ret + } + return *o.Batch +} + +// GetBatchOk returns a tuple with the Batch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetBatchOk() (*SyntheticsTestResultBatch, bool) { + if o == nil || o.Batch == nil { + return nil, false + } + return o.Batch, true +} + +// HasBatch returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasBatch() bool { + return o != nil && o.Batch != nil +} + +// SetBatch gets a reference to the given SyntheticsTestResultBatch and assigns it to the Batch field. +func (o *SyntheticsTestResultAttributes) SetBatch(v SyntheticsTestResultBatch) { + o.Batch = &v +} + +// GetCi returns the Ci field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetCi() SyntheticsTestResultCI { + if o == nil || o.Ci == nil { + var ret SyntheticsTestResultCI + return ret + } + return *o.Ci +} + +// GetCiOk returns a tuple with the Ci field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetCiOk() (*SyntheticsTestResultCI, bool) { + if o == nil || o.Ci == nil { + return nil, false + } + return o.Ci, true +} + +// HasCi returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasCi() bool { + return o != nil && o.Ci != nil +} + +// SetCi gets a reference to the given SyntheticsTestResultCI and assigns it to the Ci field. +func (o *SyntheticsTestResultAttributes) SetCi(v SyntheticsTestResultCI) { + o.Ci = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetDevice() SyntheticsTestResultDevice { + if o == nil || o.Device == nil { + var ret SyntheticsTestResultDevice + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetDeviceOk() (*SyntheticsTestResultDevice, bool) { + if o == nil || o.Device == nil { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasDevice() bool { + return o != nil && o.Device != nil +} + +// SetDevice gets a reference to the given SyntheticsTestResultDevice and assigns it to the Device field. +func (o *SyntheticsTestResultAttributes) SetDevice(v SyntheticsTestResultDevice) { + o.Device = &v +} + +// GetGit returns the Git field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetGit() SyntheticsTestResultGit { + if o == nil || o.Git == nil { + var ret SyntheticsTestResultGit + return ret + } + return *o.Git +} + +// GetGitOk returns a tuple with the Git field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetGitOk() (*SyntheticsTestResultGit, bool) { + if o == nil || o.Git == nil { + return nil, false + } + return o.Git, true +} + +// HasGit returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasGit() bool { + return o != nil && o.Git != nil +} + +// SetGit gets a reference to the given SyntheticsTestResultGit and assigns it to the Git field. +func (o *SyntheticsTestResultAttributes) SetGit(v SyntheticsTestResultGit) { + o.Git = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetLocation() SyntheticsTestResultLocation { + if o == nil || o.Location == nil { + var ret SyntheticsTestResultLocation + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetLocationOk() (*SyntheticsTestResultLocation, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasLocation() bool { + return o != nil && o.Location != nil +} + +// SetLocation gets a reference to the given SyntheticsTestResultLocation and assigns it to the Location field. +func (o *SyntheticsTestResultAttributes) SetLocation(v SyntheticsTestResultLocation) { + o.Location = &v +} + +// GetResult returns the Result field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetResult() SyntheticsTestResultDetail { + if o == nil || o.Result == nil { + var ret SyntheticsTestResultDetail + return ret + } + return *o.Result +} + +// GetResultOk returns a tuple with the Result field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetResultOk() (*SyntheticsTestResultDetail, bool) { + if o == nil || o.Result == nil { + return nil, false + } + return o.Result, true +} + +// HasResult returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasResult() bool { + return o != nil && o.Result != nil +} + +// SetResult gets a reference to the given SyntheticsTestResultDetail and assigns it to the Result field. +func (o *SyntheticsTestResultAttributes) SetResult(v SyntheticsTestResultDetail) { + o.Result = &v +} + +// GetTestSubType returns the TestSubType field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetTestSubType() SyntheticsTestSubType { + if o == nil || o.TestSubType == nil { + var ret SyntheticsTestSubType + return ret + } + return *o.TestSubType +} + +// GetTestSubTypeOk returns a tuple with the TestSubType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetTestSubTypeOk() (*SyntheticsTestSubType, bool) { + if o == nil || o.TestSubType == nil { + return nil, false + } + return o.TestSubType, true +} + +// HasTestSubType returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasTestSubType() bool { + return o != nil && o.TestSubType != nil +} + +// SetTestSubType gets a reference to the given SyntheticsTestSubType and assigns it to the TestSubType field. +func (o *SyntheticsTestResultAttributes) SetTestSubType(v SyntheticsTestSubType) { + o.TestSubType = &v +} + +// GetTestType returns the TestType field value if set, zero value otherwise. +func (o *SyntheticsTestResultAttributes) GetTestType() SyntheticsTestType { + if o == nil || o.TestType == nil { + var ret SyntheticsTestType + return ret + } + return *o.TestType +} + +// GetTestTypeOk returns a tuple with the TestType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultAttributes) GetTestTypeOk() (*SyntheticsTestType, bool) { + if o == nil || o.TestType == nil { + return nil, false + } + return o.TestType, true +} + +// HasTestType returns a boolean if a field has been set. +func (o *SyntheticsTestResultAttributes) HasTestType() bool { + return o != nil && o.TestType != nil +} + +// SetTestType gets a reference to the given SyntheticsTestType and assigns it to the TestType field. +func (o *SyntheticsTestResultAttributes) SetTestType(v SyntheticsTestType) { + o.TestType = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Batch != nil { + toSerialize["batch"] = o.Batch + } + if o.Ci != nil { + toSerialize["ci"] = o.Ci + } + if o.Device != nil { + toSerialize["device"] = o.Device + } + if o.Git != nil { + toSerialize["git"] = o.Git + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.Result != nil { + toSerialize["result"] = o.Result + } + if o.TestSubType != nil { + toSerialize["test_sub_type"] = o.TestSubType + } + if o.TestType != nil { + toSerialize["test_type"] = o.TestType + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Batch *SyntheticsTestResultBatch `json:"batch,omitempty"` + Ci *SyntheticsTestResultCI `json:"ci,omitempty"` + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + Git *SyntheticsTestResultGit `json:"git,omitempty"` + Location *SyntheticsTestResultLocation `json:"location,omitempty"` + Result *SyntheticsTestResultDetail `json:"result,omitempty"` + TestSubType *SyntheticsTestSubType `json:"test_sub_type,omitempty"` + TestType *SyntheticsTestType `json:"test_type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"batch", "ci", "device", "git", "location", "result", "test_sub_type", "test_type"}) + } else { + return err + } + + hasInvalidField := false + if all.Batch != nil && all.Batch.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Batch = all.Batch + if all.Ci != nil && all.Ci.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Ci = all.Ci + if all.Device != nil && all.Device.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Device = all.Device + if all.Git != nil && all.Git.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Git = all.Git + if all.Location != nil && all.Location.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Location = all.Location + if all.Result != nil && all.Result.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Result = all.Result + if all.TestSubType != nil && !all.TestSubType.IsValid() { + hasInvalidField = true + } else { + o.TestSubType = all.TestSubType + } + if all.TestType != nil && !all.TestType.IsValid() { + hasInvalidField = true + } else { + o.TestType = all.TestType + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_batch.go b/api/datadogV2/model_synthetics_test_result_batch.go new file mode 100644 index 00000000000..b4824a8a111 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_batch.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultBatch Batch information for the test result. +type SyntheticsTestResultBatch struct { + // Batch identifier. + Id *string `json:"id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultBatch instantiates a new SyntheticsTestResultBatch object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultBatch() *SyntheticsTestResultBatch { + this := SyntheticsTestResultBatch{} + return &this +} + +// NewSyntheticsTestResultBatchWithDefaults instantiates a new SyntheticsTestResultBatch object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultBatchWithDefaults() *SyntheticsTestResultBatch { + this := SyntheticsTestResultBatch{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultBatch) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBatch) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultBatch) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultBatch) SetId(v string) { + o.Id = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultBatch) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultBatch) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id"}) + } else { + return err + } + o.Id = all.Id + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_bounds.go b/api/datadogV2/model_synthetics_test_result_bounds.go new file mode 100644 index 00000000000..b644db0fb4a --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_bounds.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultBounds Bounding box of an element on the page. +type SyntheticsTestResultBounds struct { + // Height in pixels. + Height *int64 `json:"height,omitempty"` + // Width in pixels. + Width *int64 `json:"width,omitempty"` + // Horizontal position in pixels. + X *int64 `json:"x,omitempty"` + // Vertical position in pixels. + Y *int64 `json:"y,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultBounds instantiates a new SyntheticsTestResultBounds object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultBounds() *SyntheticsTestResultBounds { + this := SyntheticsTestResultBounds{} + return &this +} + +// NewSyntheticsTestResultBoundsWithDefaults instantiates a new SyntheticsTestResultBounds object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultBoundsWithDefaults() *SyntheticsTestResultBounds { + this := SyntheticsTestResultBounds{} + return &this +} + +// GetHeight returns the Height field value if set, zero value otherwise. +func (o *SyntheticsTestResultBounds) GetHeight() int64 { + if o == nil || o.Height == nil { + var ret int64 + return ret + } + return *o.Height +} + +// GetHeightOk returns a tuple with the Height field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBounds) GetHeightOk() (*int64, bool) { + if o == nil || o.Height == nil { + return nil, false + } + return o.Height, true +} + +// HasHeight returns a boolean if a field has been set. +func (o *SyntheticsTestResultBounds) HasHeight() bool { + return o != nil && o.Height != nil +} + +// SetHeight gets a reference to the given int64 and assigns it to the Height field. +func (o *SyntheticsTestResultBounds) SetHeight(v int64) { + o.Height = &v +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *SyntheticsTestResultBounds) GetWidth() int64 { + if o == nil || o.Width == nil { + var ret int64 + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBounds) GetWidthOk() (*int64, bool) { + if o == nil || o.Width == nil { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *SyntheticsTestResultBounds) HasWidth() bool { + return o != nil && o.Width != nil +} + +// SetWidth gets a reference to the given int64 and assigns it to the Width field. +func (o *SyntheticsTestResultBounds) SetWidth(v int64) { + o.Width = &v +} + +// GetX returns the X field value if set, zero value otherwise. +func (o *SyntheticsTestResultBounds) GetX() int64 { + if o == nil || o.X == nil { + var ret int64 + return ret + } + return *o.X +} + +// GetXOk returns a tuple with the X field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBounds) GetXOk() (*int64, bool) { + if o == nil || o.X == nil { + return nil, false + } + return o.X, true +} + +// HasX returns a boolean if a field has been set. +func (o *SyntheticsTestResultBounds) HasX() bool { + return o != nil && o.X != nil +} + +// SetX gets a reference to the given int64 and assigns it to the X field. +func (o *SyntheticsTestResultBounds) SetX(v int64) { + o.X = &v +} + +// GetY returns the Y field value if set, zero value otherwise. +func (o *SyntheticsTestResultBounds) GetY() int64 { + if o == nil || o.Y == nil { + var ret int64 + return ret + } + return *o.Y +} + +// GetYOk returns a tuple with the Y field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBounds) GetYOk() (*int64, bool) { + if o == nil || o.Y == nil { + return nil, false + } + return o.Y, true +} + +// HasY returns a boolean if a field has been set. +func (o *SyntheticsTestResultBounds) HasY() bool { + return o != nil && o.Y != nil +} + +// SetY gets a reference to the given int64 and assigns it to the Y field. +func (o *SyntheticsTestResultBounds) SetY(v int64) { + o.Y = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultBounds) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Height != nil { + toSerialize["height"] = o.Height + } + if o.Width != nil { + toSerialize["width"] = o.Width + } + if o.X != nil { + toSerialize["x"] = o.X + } + if o.Y != nil { + toSerialize["y"] = o.Y + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultBounds) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Height *int64 `json:"height,omitempty"` + Width *int64 `json:"width,omitempty"` + X *int64 `json:"x,omitempty"` + Y *int64 `json:"y,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"height", "width", "x", "y"}) + } else { + return err + } + o.Height = all.Height + o.Width = all.Width + o.X = all.X + o.Y = all.Y + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_browser_error.go b/api/datadogV2/model_synthetics_test_result_browser_error.go new file mode 100644 index 00000000000..d58530de9df --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_browser_error.go @@ -0,0 +1,277 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultBrowserError A browser error captured during a browser test step. +type SyntheticsTestResultBrowserError struct { + // Error description. + Description *string `json:"description,omitempty"` + // HTTP method associated with the error (for network errors). + Method *string `json:"method,omitempty"` + // Error name. + Name *string `json:"name,omitempty"` + // HTTP status code associated with the error (for network errors). + Status *int64 `json:"status,omitempty"` + // Type of the browser error. + Type *string `json:"type,omitempty"` + // URL associated with the error. + Url map[string]interface{} `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultBrowserError instantiates a new SyntheticsTestResultBrowserError object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultBrowserError() *SyntheticsTestResultBrowserError { + this := SyntheticsTestResultBrowserError{} + return &this +} + +// NewSyntheticsTestResultBrowserErrorWithDefaults instantiates a new SyntheticsTestResultBrowserError object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultBrowserErrorWithDefaults() *SyntheticsTestResultBrowserError { + this := SyntheticsTestResultBrowserError{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SyntheticsTestResultBrowserError) SetDescription(v string) { + o.Description = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetMethod() string { + if o == nil || o.Method == nil { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetMethodOk() (*string, bool) { + if o == nil || o.Method == nil { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasMethod() bool { + return o != nil && o.Method != nil +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *SyntheticsTestResultBrowserError) SetMethod(v string) { + o.Method = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultBrowserError) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetStatus() int64 { + if o == nil || o.Status == nil { + var ret int64 + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetStatusOk() (*int64, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given int64 and assigns it to the Status field. +func (o *SyntheticsTestResultBrowserError) SetStatus(v int64) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultBrowserError) SetType(v string) { + o.Type = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultBrowserError) GetUrl() map[string]interface{} { + if o == nil || o.Url == nil { + var ret map[string]interface{} + return ret + } + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBrowserError) GetUrlOk() (*map[string]interface{}, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return &o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultBrowserError) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given map[string]interface{} and assigns it to the Url field. +func (o *SyntheticsTestResultBrowserError) SetUrl(v map[string]interface{}) { + o.Url = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultBrowserError) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Method != nil { + toSerialize["method"] = o.Method + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultBrowserError) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Method *string `json:"method,omitempty"` + Name *string `json:"name,omitempty"` + Status *int64 `json:"status,omitempty"` + Type *string `json:"type,omitempty"` + Url map[string]interface{} `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "method", "name", "status", "type", "url"}) + } else { + return err + } + o.Description = all.Description + o.Method = all.Method + o.Name = all.Name + o.Status = all.Status + o.Type = all.Type + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_bucket_keys.go b/api/datadogV2/model_synthetics_test_result_bucket_keys.go new file mode 100644 index 00000000000..451a693728c --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_bucket_keys.go @@ -0,0 +1,452 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultBucketKeys Storage bucket keys for artifacts produced during a step or test. +type SyntheticsTestResultBucketKeys struct { + // Key for the screenshot captured after the step (goal-based tests). + AfterStepScreenshot *string `json:"after_step_screenshot,omitempty"` + // Key for the screenshot captured after the turn (goal-based tests). + AfterTurnScreenshot *string `json:"after_turn_screenshot,omitempty"` + // Key for miscellaneous artifacts. + Artifacts *string `json:"artifacts,omitempty"` + // Key for the screenshot captured before the step (goal-based tests). + BeforeStepScreenshot *string `json:"before_step_screenshot,omitempty"` + // Key for the screenshot captured before the turn (goal-based tests). + BeforeTurnScreenshot *string `json:"before_turn_screenshot,omitempty"` + // Key for a captured crash report. + CrashReport *string `json:"crash_report,omitempty"` + // Key for captured device logs. + DeviceLogs *string `json:"device_logs,omitempty"` + // Keys for email message payloads captured by the step. + EmailMessages []string `json:"email_messages,omitempty"` + // Key for the captured screenshot. + Screenshot *string `json:"screenshot,omitempty"` + // Key for the captured DOM snapshot. + Snapshot *string `json:"snapshot,omitempty"` + // Key for the page source or element source. + Source *string `json:"source,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultBucketKeys instantiates a new SyntheticsTestResultBucketKeys object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultBucketKeys() *SyntheticsTestResultBucketKeys { + this := SyntheticsTestResultBucketKeys{} + return &this +} + +// NewSyntheticsTestResultBucketKeysWithDefaults instantiates a new SyntheticsTestResultBucketKeys object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultBucketKeysWithDefaults() *SyntheticsTestResultBucketKeys { + this := SyntheticsTestResultBucketKeys{} + return &this +} + +// GetAfterStepScreenshot returns the AfterStepScreenshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetAfterStepScreenshot() string { + if o == nil || o.AfterStepScreenshot == nil { + var ret string + return ret + } + return *o.AfterStepScreenshot +} + +// GetAfterStepScreenshotOk returns a tuple with the AfterStepScreenshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetAfterStepScreenshotOk() (*string, bool) { + if o == nil || o.AfterStepScreenshot == nil { + return nil, false + } + return o.AfterStepScreenshot, true +} + +// HasAfterStepScreenshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasAfterStepScreenshot() bool { + return o != nil && o.AfterStepScreenshot != nil +} + +// SetAfterStepScreenshot gets a reference to the given string and assigns it to the AfterStepScreenshot field. +func (o *SyntheticsTestResultBucketKeys) SetAfterStepScreenshot(v string) { + o.AfterStepScreenshot = &v +} + +// GetAfterTurnScreenshot returns the AfterTurnScreenshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetAfterTurnScreenshot() string { + if o == nil || o.AfterTurnScreenshot == nil { + var ret string + return ret + } + return *o.AfterTurnScreenshot +} + +// GetAfterTurnScreenshotOk returns a tuple with the AfterTurnScreenshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetAfterTurnScreenshotOk() (*string, bool) { + if o == nil || o.AfterTurnScreenshot == nil { + return nil, false + } + return o.AfterTurnScreenshot, true +} + +// HasAfterTurnScreenshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasAfterTurnScreenshot() bool { + return o != nil && o.AfterTurnScreenshot != nil +} + +// SetAfterTurnScreenshot gets a reference to the given string and assigns it to the AfterTurnScreenshot field. +func (o *SyntheticsTestResultBucketKeys) SetAfterTurnScreenshot(v string) { + o.AfterTurnScreenshot = &v +} + +// GetArtifacts returns the Artifacts field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetArtifacts() string { + if o == nil || o.Artifacts == nil { + var ret string + return ret + } + return *o.Artifacts +} + +// GetArtifactsOk returns a tuple with the Artifacts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetArtifactsOk() (*string, bool) { + if o == nil || o.Artifacts == nil { + return nil, false + } + return o.Artifacts, true +} + +// HasArtifacts returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasArtifacts() bool { + return o != nil && o.Artifacts != nil +} + +// SetArtifacts gets a reference to the given string and assigns it to the Artifacts field. +func (o *SyntheticsTestResultBucketKeys) SetArtifacts(v string) { + o.Artifacts = &v +} + +// GetBeforeStepScreenshot returns the BeforeStepScreenshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetBeforeStepScreenshot() string { + if o == nil || o.BeforeStepScreenshot == nil { + var ret string + return ret + } + return *o.BeforeStepScreenshot +} + +// GetBeforeStepScreenshotOk returns a tuple with the BeforeStepScreenshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetBeforeStepScreenshotOk() (*string, bool) { + if o == nil || o.BeforeStepScreenshot == nil { + return nil, false + } + return o.BeforeStepScreenshot, true +} + +// HasBeforeStepScreenshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasBeforeStepScreenshot() bool { + return o != nil && o.BeforeStepScreenshot != nil +} + +// SetBeforeStepScreenshot gets a reference to the given string and assigns it to the BeforeStepScreenshot field. +func (o *SyntheticsTestResultBucketKeys) SetBeforeStepScreenshot(v string) { + o.BeforeStepScreenshot = &v +} + +// GetBeforeTurnScreenshot returns the BeforeTurnScreenshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetBeforeTurnScreenshot() string { + if o == nil || o.BeforeTurnScreenshot == nil { + var ret string + return ret + } + return *o.BeforeTurnScreenshot +} + +// GetBeforeTurnScreenshotOk returns a tuple with the BeforeTurnScreenshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetBeforeTurnScreenshotOk() (*string, bool) { + if o == nil || o.BeforeTurnScreenshot == nil { + return nil, false + } + return o.BeforeTurnScreenshot, true +} + +// HasBeforeTurnScreenshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasBeforeTurnScreenshot() bool { + return o != nil && o.BeforeTurnScreenshot != nil +} + +// SetBeforeTurnScreenshot gets a reference to the given string and assigns it to the BeforeTurnScreenshot field. +func (o *SyntheticsTestResultBucketKeys) SetBeforeTurnScreenshot(v string) { + o.BeforeTurnScreenshot = &v +} + +// GetCrashReport returns the CrashReport field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetCrashReport() string { + if o == nil || o.CrashReport == nil { + var ret string + return ret + } + return *o.CrashReport +} + +// GetCrashReportOk returns a tuple with the CrashReport field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetCrashReportOk() (*string, bool) { + if o == nil || o.CrashReport == nil { + return nil, false + } + return o.CrashReport, true +} + +// HasCrashReport returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasCrashReport() bool { + return o != nil && o.CrashReport != nil +} + +// SetCrashReport gets a reference to the given string and assigns it to the CrashReport field. +func (o *SyntheticsTestResultBucketKeys) SetCrashReport(v string) { + o.CrashReport = &v +} + +// GetDeviceLogs returns the DeviceLogs field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetDeviceLogs() string { + if o == nil || o.DeviceLogs == nil { + var ret string + return ret + } + return *o.DeviceLogs +} + +// GetDeviceLogsOk returns a tuple with the DeviceLogs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetDeviceLogsOk() (*string, bool) { + if o == nil || o.DeviceLogs == nil { + return nil, false + } + return o.DeviceLogs, true +} + +// HasDeviceLogs returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasDeviceLogs() bool { + return o != nil && o.DeviceLogs != nil +} + +// SetDeviceLogs gets a reference to the given string and assigns it to the DeviceLogs field. +func (o *SyntheticsTestResultBucketKeys) SetDeviceLogs(v string) { + o.DeviceLogs = &v +} + +// GetEmailMessages returns the EmailMessages field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetEmailMessages() []string { + if o == nil || o.EmailMessages == nil { + var ret []string + return ret + } + return o.EmailMessages +} + +// GetEmailMessagesOk returns a tuple with the EmailMessages field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetEmailMessagesOk() (*[]string, bool) { + if o == nil || o.EmailMessages == nil { + return nil, false + } + return &o.EmailMessages, true +} + +// HasEmailMessages returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasEmailMessages() bool { + return o != nil && o.EmailMessages != nil +} + +// SetEmailMessages gets a reference to the given []string and assigns it to the EmailMessages field. +func (o *SyntheticsTestResultBucketKeys) SetEmailMessages(v []string) { + o.EmailMessages = v +} + +// GetScreenshot returns the Screenshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetScreenshot() string { + if o == nil || o.Screenshot == nil { + var ret string + return ret + } + return *o.Screenshot +} + +// GetScreenshotOk returns a tuple with the Screenshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetScreenshotOk() (*string, bool) { + if o == nil || o.Screenshot == nil { + return nil, false + } + return o.Screenshot, true +} + +// HasScreenshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasScreenshot() bool { + return o != nil && o.Screenshot != nil +} + +// SetScreenshot gets a reference to the given string and assigns it to the Screenshot field. +func (o *SyntheticsTestResultBucketKeys) SetScreenshot(v string) { + o.Screenshot = &v +} + +// GetSnapshot returns the Snapshot field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetSnapshot() string { + if o == nil || o.Snapshot == nil { + var ret string + return ret + } + return *o.Snapshot +} + +// GetSnapshotOk returns a tuple with the Snapshot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetSnapshotOk() (*string, bool) { + if o == nil || o.Snapshot == nil { + return nil, false + } + return o.Snapshot, true +} + +// HasSnapshot returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasSnapshot() bool { + return o != nil && o.Snapshot != nil +} + +// SetSnapshot gets a reference to the given string and assigns it to the Snapshot field. +func (o *SyntheticsTestResultBucketKeys) SetSnapshot(v string) { + o.Snapshot = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *SyntheticsTestResultBucketKeys) GetSource() string { + if o == nil || o.Source == nil { + var ret string + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultBucketKeys) GetSourceOk() (*string, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *SyntheticsTestResultBucketKeys) HasSource() bool { + return o != nil && o.Source != nil +} + +// SetSource gets a reference to the given string and assigns it to the Source field. +func (o *SyntheticsTestResultBucketKeys) SetSource(v string) { + o.Source = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultBucketKeys) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AfterStepScreenshot != nil { + toSerialize["after_step_screenshot"] = o.AfterStepScreenshot + } + if o.AfterTurnScreenshot != nil { + toSerialize["after_turn_screenshot"] = o.AfterTurnScreenshot + } + if o.Artifacts != nil { + toSerialize["artifacts"] = o.Artifacts + } + if o.BeforeStepScreenshot != nil { + toSerialize["before_step_screenshot"] = o.BeforeStepScreenshot + } + if o.BeforeTurnScreenshot != nil { + toSerialize["before_turn_screenshot"] = o.BeforeTurnScreenshot + } + if o.CrashReport != nil { + toSerialize["crash_report"] = o.CrashReport + } + if o.DeviceLogs != nil { + toSerialize["device_logs"] = o.DeviceLogs + } + if o.EmailMessages != nil { + toSerialize["email_messages"] = o.EmailMessages + } + if o.Screenshot != nil { + toSerialize["screenshot"] = o.Screenshot + } + if o.Snapshot != nil { + toSerialize["snapshot"] = o.Snapshot + } + if o.Source != nil { + toSerialize["source"] = o.Source + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultBucketKeys) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AfterStepScreenshot *string `json:"after_step_screenshot,omitempty"` + AfterTurnScreenshot *string `json:"after_turn_screenshot,omitempty"` + Artifacts *string `json:"artifacts,omitempty"` + BeforeStepScreenshot *string `json:"before_step_screenshot,omitempty"` + BeforeTurnScreenshot *string `json:"before_turn_screenshot,omitempty"` + CrashReport *string `json:"crash_report,omitempty"` + DeviceLogs *string `json:"device_logs,omitempty"` + EmailMessages []string `json:"email_messages,omitempty"` + Screenshot *string `json:"screenshot,omitempty"` + Snapshot *string `json:"snapshot,omitempty"` + Source *string `json:"source,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"after_step_screenshot", "after_turn_screenshot", "artifacts", "before_step_screenshot", "before_turn_screenshot", "crash_report", "device_logs", "email_messages", "screenshot", "snapshot", "source"}) + } else { + return err + } + o.AfterStepScreenshot = all.AfterStepScreenshot + o.AfterTurnScreenshot = all.AfterTurnScreenshot + o.Artifacts = all.Artifacts + o.BeforeStepScreenshot = all.BeforeStepScreenshot + o.BeforeTurnScreenshot = all.BeforeTurnScreenshot + o.CrashReport = all.CrashReport + o.DeviceLogs = all.DeviceLogs + o.EmailMessages = all.EmailMessages + o.Screenshot = all.Screenshot + o.Snapshot = all.Snapshot + o.Source = all.Source + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_cdn_cache_status.go b/api/datadogV2/model_synthetics_test_result_cdn_cache_status.go new file mode 100644 index 00000000000..a23ad7e9baf --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_cdn_cache_status.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCdnCacheStatus Cache status reported by the CDN for the response. +type SyntheticsTestResultCdnCacheStatus struct { + // Whether the response was served from the CDN cache. + Cached *bool `json:"cached,omitempty"` + // Raw cache status string reported by the CDN. + Status *string `json:"status,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCdnCacheStatus instantiates a new SyntheticsTestResultCdnCacheStatus object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCdnCacheStatus() *SyntheticsTestResultCdnCacheStatus { + this := SyntheticsTestResultCdnCacheStatus{} + return &this +} + +// NewSyntheticsTestResultCdnCacheStatusWithDefaults instantiates a new SyntheticsTestResultCdnCacheStatus object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCdnCacheStatusWithDefaults() *SyntheticsTestResultCdnCacheStatus { + this := SyntheticsTestResultCdnCacheStatus{} + return &this +} + +// GetCached returns the Cached field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnCacheStatus) GetCached() bool { + if o == nil || o.Cached == nil { + var ret bool + return ret + } + return *o.Cached +} + +// GetCachedOk returns a tuple with the Cached field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnCacheStatus) GetCachedOk() (*bool, bool) { + if o == nil || o.Cached == nil { + return nil, false + } + return o.Cached, true +} + +// HasCached returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnCacheStatus) HasCached() bool { + return o != nil && o.Cached != nil +} + +// SetCached gets a reference to the given bool and assigns it to the Cached field. +func (o *SyntheticsTestResultCdnCacheStatus) SetCached(v bool) { + o.Cached = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnCacheStatus) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnCacheStatus) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnCacheStatus) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SyntheticsTestResultCdnCacheStatus) SetStatus(v string) { + o.Status = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCdnCacheStatus) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cached != nil { + toSerialize["cached"] = o.Cached + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCdnCacheStatus) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cached *bool `json:"cached,omitempty"` + Status *string `json:"status,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cached", "status"}) + } else { + return err + } + o.Cached = all.Cached + o.Status = all.Status + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_cdn_provider_info.go b/api/datadogV2/model_synthetics_test_result_cdn_provider_info.go new file mode 100644 index 00000000000..dfde12b8b33 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_cdn_provider_info.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCdnProviderInfo CDN provider details inferred from response headers. +type SyntheticsTestResultCdnProviderInfo struct { + // Cache status reported by the CDN for the response. + Cache *SyntheticsTestResultCdnCacheStatus `json:"cache,omitempty"` + // Name of the CDN provider. + Provider *string `json:"provider,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCdnProviderInfo instantiates a new SyntheticsTestResultCdnProviderInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCdnProviderInfo() *SyntheticsTestResultCdnProviderInfo { + this := SyntheticsTestResultCdnProviderInfo{} + return &this +} + +// NewSyntheticsTestResultCdnProviderInfoWithDefaults instantiates a new SyntheticsTestResultCdnProviderInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCdnProviderInfoWithDefaults() *SyntheticsTestResultCdnProviderInfo { + this := SyntheticsTestResultCdnProviderInfo{} + return &this +} + +// GetCache returns the Cache field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnProviderInfo) GetCache() SyntheticsTestResultCdnCacheStatus { + if o == nil || o.Cache == nil { + var ret SyntheticsTestResultCdnCacheStatus + return ret + } + return *o.Cache +} + +// GetCacheOk returns a tuple with the Cache field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnProviderInfo) GetCacheOk() (*SyntheticsTestResultCdnCacheStatus, bool) { + if o == nil || o.Cache == nil { + return nil, false + } + return o.Cache, true +} + +// HasCache returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnProviderInfo) HasCache() bool { + return o != nil && o.Cache != nil +} + +// SetCache gets a reference to the given SyntheticsTestResultCdnCacheStatus and assigns it to the Cache field. +func (o *SyntheticsTestResultCdnProviderInfo) SetCache(v SyntheticsTestResultCdnCacheStatus) { + o.Cache = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnProviderInfo) GetProvider() string { + if o == nil || o.Provider == nil { + var ret string + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnProviderInfo) GetProviderOk() (*string, bool) { + if o == nil || o.Provider == nil { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnProviderInfo) HasProvider() bool { + return o != nil && o.Provider != nil +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +func (o *SyntheticsTestResultCdnProviderInfo) SetProvider(v string) { + o.Provider = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCdnProviderInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cache != nil { + toSerialize["cache"] = o.Cache + } + if o.Provider != nil { + toSerialize["provider"] = o.Provider + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCdnProviderInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cache *SyntheticsTestResultCdnCacheStatus `json:"cache,omitempty"` + Provider *string `json:"provider,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cache", "provider"}) + } else { + return err + } + + hasInvalidField := false + if all.Cache != nil && all.Cache.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Cache = all.Cache + o.Provider = all.Provider + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_cdn_resource.go b/api/datadogV2/model_synthetics_test_result_cdn_resource.go new file mode 100644 index 00000000000..f2003eb74af --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_cdn_resource.go @@ -0,0 +1,216 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCdnResource A CDN resource encountered while executing a browser step. +type SyntheticsTestResultCdnResource struct { + // CDN provider details inferred from response headers. + Cdn *SyntheticsTestResultCdnProviderInfo `json:"cdn,omitempty"` + // Resolved IP address for the CDN resource. + ResolvedIp *string `json:"resolved_ip,omitempty"` + // Unix timestamp (ms) of when the resource was fetched. + Timestamp *int64 `json:"timestamp,omitempty"` + // Timing breakdown for fetching the CDN resource. + Timings map[string]interface{} `json:"timings,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCdnResource instantiates a new SyntheticsTestResultCdnResource object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCdnResource() *SyntheticsTestResultCdnResource { + this := SyntheticsTestResultCdnResource{} + return &this +} + +// NewSyntheticsTestResultCdnResourceWithDefaults instantiates a new SyntheticsTestResultCdnResource object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCdnResourceWithDefaults() *SyntheticsTestResultCdnResource { + this := SyntheticsTestResultCdnResource{} + return &this +} + +// GetCdn returns the Cdn field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnResource) GetCdn() SyntheticsTestResultCdnProviderInfo { + if o == nil || o.Cdn == nil { + var ret SyntheticsTestResultCdnProviderInfo + return ret + } + return *o.Cdn +} + +// GetCdnOk returns a tuple with the Cdn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnResource) GetCdnOk() (*SyntheticsTestResultCdnProviderInfo, bool) { + if o == nil || o.Cdn == nil { + return nil, false + } + return o.Cdn, true +} + +// HasCdn returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnResource) HasCdn() bool { + return o != nil && o.Cdn != nil +} + +// SetCdn gets a reference to the given SyntheticsTestResultCdnProviderInfo and assigns it to the Cdn field. +func (o *SyntheticsTestResultCdnResource) SetCdn(v SyntheticsTestResultCdnProviderInfo) { + o.Cdn = &v +} + +// GetResolvedIp returns the ResolvedIp field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnResource) GetResolvedIp() string { + if o == nil || o.ResolvedIp == nil { + var ret string + return ret + } + return *o.ResolvedIp +} + +// GetResolvedIpOk returns a tuple with the ResolvedIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnResource) GetResolvedIpOk() (*string, bool) { + if o == nil || o.ResolvedIp == nil { + return nil, false + } + return o.ResolvedIp, true +} + +// HasResolvedIp returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnResource) HasResolvedIp() bool { + return o != nil && o.ResolvedIp != nil +} + +// SetResolvedIp gets a reference to the given string and assigns it to the ResolvedIp field. +func (o *SyntheticsTestResultCdnResource) SetResolvedIp(v string) { + o.ResolvedIp = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnResource) GetTimestamp() int64 { + if o == nil || o.Timestamp == nil { + var ret int64 + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnResource) GetTimestampOk() (*int64, bool) { + if o == nil || o.Timestamp == nil { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnResource) HasTimestamp() bool { + return o != nil && o.Timestamp != nil +} + +// SetTimestamp gets a reference to the given int64 and assigns it to the Timestamp field. +func (o *SyntheticsTestResultCdnResource) SetTimestamp(v int64) { + o.Timestamp = &v +} + +// GetTimings returns the Timings field value if set, zero value otherwise. +func (o *SyntheticsTestResultCdnResource) GetTimings() map[string]interface{} { + if o == nil || o.Timings == nil { + var ret map[string]interface{} + return ret + } + return o.Timings +} + +// GetTimingsOk returns a tuple with the Timings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCdnResource) GetTimingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Timings == nil { + return nil, false + } + return &o.Timings, true +} + +// HasTimings returns a boolean if a field has been set. +func (o *SyntheticsTestResultCdnResource) HasTimings() bool { + return o != nil && o.Timings != nil +} + +// SetTimings gets a reference to the given map[string]interface{} and assigns it to the Timings field. +func (o *SyntheticsTestResultCdnResource) SetTimings(v map[string]interface{}) { + o.Timings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCdnResource) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cdn != nil { + toSerialize["cdn"] = o.Cdn + } + if o.ResolvedIp != nil { + toSerialize["resolved_ip"] = o.ResolvedIp + } + if o.Timestamp != nil { + toSerialize["timestamp"] = o.Timestamp + } + if o.Timings != nil { + toSerialize["timings"] = o.Timings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCdnResource) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cdn *SyntheticsTestResultCdnProviderInfo `json:"cdn,omitempty"` + ResolvedIp *string `json:"resolved_ip,omitempty"` + Timestamp *int64 `json:"timestamp,omitempty"` + Timings map[string]interface{} `json:"timings,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cdn", "resolved_ip", "timestamp", "timings"}) + } else { + return err + } + + hasInvalidField := false + if all.Cdn != nil && all.Cdn.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Cdn = all.Cdn + o.ResolvedIp = all.ResolvedIp + o.Timestamp = all.Timestamp + o.Timings = all.Timings + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_certificate.go b/api/datadogV2/model_synthetics_test_result_certificate.go new file mode 100644 index 00000000000..27f955261cc --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_certificate.go @@ -0,0 +1,496 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCertificate SSL/TLS certificate information returned from an SSL test. +type SyntheticsTestResultCertificate struct { + // Cipher used for the TLS connection. + Cipher *string `json:"cipher,omitempty"` + // RSA exponent of the certificate. + Exponent *int64 `json:"exponent,omitempty"` + // Extended key usage extensions for the certificate. + ExtKeyUsage []string `json:"ext_key_usage,omitempty"` + // SHA-1 fingerprint of the certificate. + Fingerprint *string `json:"fingerprint,omitempty"` + // SHA-256 fingerprint of the certificate. + Fingerprint256 *string `json:"fingerprint256,omitempty"` + // Certificate issuer details. + Issuer map[string]string `json:"issuer,omitempty"` + // RSA modulus of the certificate. + Modulus *string `json:"modulus,omitempty"` + // TLS protocol used (for example, `TLSv1.2`). + Protocol *string `json:"protocol,omitempty"` + // Serial number of the certificate. + SerialNumber *string `json:"serial_number,omitempty"` + // Certificate subject details. + Subject map[string]string `json:"subject,omitempty"` + // TLS protocol version. + TlsVersion *float64 `json:"tls_version,omitempty"` + // Validity window of a certificate. + Valid *SyntheticsTestResultCertificateValidity `json:"valid,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCertificate instantiates a new SyntheticsTestResultCertificate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCertificate() *SyntheticsTestResultCertificate { + this := SyntheticsTestResultCertificate{} + return &this +} + +// NewSyntheticsTestResultCertificateWithDefaults instantiates a new SyntheticsTestResultCertificate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCertificateWithDefaults() *SyntheticsTestResultCertificate { + this := SyntheticsTestResultCertificate{} + return &this +} + +// GetCipher returns the Cipher field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetCipher() string { + if o == nil || o.Cipher == nil { + var ret string + return ret + } + return *o.Cipher +} + +// GetCipherOk returns a tuple with the Cipher field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetCipherOk() (*string, bool) { + if o == nil || o.Cipher == nil { + return nil, false + } + return o.Cipher, true +} + +// HasCipher returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasCipher() bool { + return o != nil && o.Cipher != nil +} + +// SetCipher gets a reference to the given string and assigns it to the Cipher field. +func (o *SyntheticsTestResultCertificate) SetCipher(v string) { + o.Cipher = &v +} + +// GetExponent returns the Exponent field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetExponent() int64 { + if o == nil || o.Exponent == nil { + var ret int64 + return ret + } + return *o.Exponent +} + +// GetExponentOk returns a tuple with the Exponent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetExponentOk() (*int64, bool) { + if o == nil || o.Exponent == nil { + return nil, false + } + return o.Exponent, true +} + +// HasExponent returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasExponent() bool { + return o != nil && o.Exponent != nil +} + +// SetExponent gets a reference to the given int64 and assigns it to the Exponent field. +func (o *SyntheticsTestResultCertificate) SetExponent(v int64) { + o.Exponent = &v +} + +// GetExtKeyUsage returns the ExtKeyUsage field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetExtKeyUsage() []string { + if o == nil || o.ExtKeyUsage == nil { + var ret []string + return ret + } + return o.ExtKeyUsage +} + +// GetExtKeyUsageOk returns a tuple with the ExtKeyUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetExtKeyUsageOk() (*[]string, bool) { + if o == nil || o.ExtKeyUsage == nil { + return nil, false + } + return &o.ExtKeyUsage, true +} + +// HasExtKeyUsage returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasExtKeyUsage() bool { + return o != nil && o.ExtKeyUsage != nil +} + +// SetExtKeyUsage gets a reference to the given []string and assigns it to the ExtKeyUsage field. +func (o *SyntheticsTestResultCertificate) SetExtKeyUsage(v []string) { + o.ExtKeyUsage = v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetFingerprint() string { + if o == nil || o.Fingerprint == nil { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetFingerprintOk() (*string, bool) { + if o == nil || o.Fingerprint == nil { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasFingerprint() bool { + return o != nil && o.Fingerprint != nil +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *SyntheticsTestResultCertificate) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetFingerprint256 returns the Fingerprint256 field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetFingerprint256() string { + if o == nil || o.Fingerprint256 == nil { + var ret string + return ret + } + return *o.Fingerprint256 +} + +// GetFingerprint256Ok returns a tuple with the Fingerprint256 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetFingerprint256Ok() (*string, bool) { + if o == nil || o.Fingerprint256 == nil { + return nil, false + } + return o.Fingerprint256, true +} + +// HasFingerprint256 returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasFingerprint256() bool { + return o != nil && o.Fingerprint256 != nil +} + +// SetFingerprint256 gets a reference to the given string and assigns it to the Fingerprint256 field. +func (o *SyntheticsTestResultCertificate) SetFingerprint256(v string) { + o.Fingerprint256 = &v +} + +// GetIssuer returns the Issuer field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetIssuer() map[string]string { + if o == nil || o.Issuer == nil { + var ret map[string]string + return ret + } + return o.Issuer +} + +// GetIssuerOk returns a tuple with the Issuer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetIssuerOk() (*map[string]string, bool) { + if o == nil || o.Issuer == nil { + return nil, false + } + return &o.Issuer, true +} + +// HasIssuer returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasIssuer() bool { + return o != nil && o.Issuer != nil +} + +// SetIssuer gets a reference to the given map[string]string and assigns it to the Issuer field. +func (o *SyntheticsTestResultCertificate) SetIssuer(v map[string]string) { + o.Issuer = v +} + +// GetModulus returns the Modulus field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetModulus() string { + if o == nil || o.Modulus == nil { + var ret string + return ret + } + return *o.Modulus +} + +// GetModulusOk returns a tuple with the Modulus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetModulusOk() (*string, bool) { + if o == nil || o.Modulus == nil { + return nil, false + } + return o.Modulus, true +} + +// HasModulus returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasModulus() bool { + return o != nil && o.Modulus != nil +} + +// SetModulus gets a reference to the given string and assigns it to the Modulus field. +func (o *SyntheticsTestResultCertificate) SetModulus(v string) { + o.Modulus = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetProtocol() string { + if o == nil || o.Protocol == nil { + var ret string + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetProtocolOk() (*string, bool) { + if o == nil || o.Protocol == nil { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasProtocol() bool { + return o != nil && o.Protocol != nil +} + +// SetProtocol gets a reference to the given string and assigns it to the Protocol field. +func (o *SyntheticsTestResultCertificate) SetProtocol(v string) { + o.Protocol = &v +} + +// GetSerialNumber returns the SerialNumber field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetSerialNumber() string { + if o == nil || o.SerialNumber == nil { + var ret string + return ret + } + return *o.SerialNumber +} + +// GetSerialNumberOk returns a tuple with the SerialNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetSerialNumberOk() (*string, bool) { + if o == nil || o.SerialNumber == nil { + return nil, false + } + return o.SerialNumber, true +} + +// HasSerialNumber returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasSerialNumber() bool { + return o != nil && o.SerialNumber != nil +} + +// SetSerialNumber gets a reference to the given string and assigns it to the SerialNumber field. +func (o *SyntheticsTestResultCertificate) SetSerialNumber(v string) { + o.SerialNumber = &v +} + +// GetSubject returns the Subject field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetSubject() map[string]string { + if o == nil || o.Subject == nil { + var ret map[string]string + return ret + } + return o.Subject +} + +// GetSubjectOk returns a tuple with the Subject field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetSubjectOk() (*map[string]string, bool) { + if o == nil || o.Subject == nil { + return nil, false + } + return &o.Subject, true +} + +// HasSubject returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasSubject() bool { + return o != nil && o.Subject != nil +} + +// SetSubject gets a reference to the given map[string]string and assigns it to the Subject field. +func (o *SyntheticsTestResultCertificate) SetSubject(v map[string]string) { + o.Subject = v +} + +// GetTlsVersion returns the TlsVersion field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetTlsVersion() float64 { + if o == nil || o.TlsVersion == nil { + var ret float64 + return ret + } + return *o.TlsVersion +} + +// GetTlsVersionOk returns a tuple with the TlsVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetTlsVersionOk() (*float64, bool) { + if o == nil || o.TlsVersion == nil { + return nil, false + } + return o.TlsVersion, true +} + +// HasTlsVersion returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasTlsVersion() bool { + return o != nil && o.TlsVersion != nil +} + +// SetTlsVersion gets a reference to the given float64 and assigns it to the TlsVersion field. +func (o *SyntheticsTestResultCertificate) SetTlsVersion(v float64) { + o.TlsVersion = &v +} + +// GetValid returns the Valid field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificate) GetValid() SyntheticsTestResultCertificateValidity { + if o == nil || o.Valid == nil { + var ret SyntheticsTestResultCertificateValidity + return ret + } + return *o.Valid +} + +// GetValidOk returns a tuple with the Valid field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificate) GetValidOk() (*SyntheticsTestResultCertificateValidity, bool) { + if o == nil || o.Valid == nil { + return nil, false + } + return o.Valid, true +} + +// HasValid returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificate) HasValid() bool { + return o != nil && o.Valid != nil +} + +// SetValid gets a reference to the given SyntheticsTestResultCertificateValidity and assigns it to the Valid field. +func (o *SyntheticsTestResultCertificate) SetValid(v SyntheticsTestResultCertificateValidity) { + o.Valid = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCertificate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cipher != nil { + toSerialize["cipher"] = o.Cipher + } + if o.Exponent != nil { + toSerialize["exponent"] = o.Exponent + } + if o.ExtKeyUsage != nil { + toSerialize["ext_key_usage"] = o.ExtKeyUsage + } + if o.Fingerprint != nil { + toSerialize["fingerprint"] = o.Fingerprint + } + if o.Fingerprint256 != nil { + toSerialize["fingerprint256"] = o.Fingerprint256 + } + if o.Issuer != nil { + toSerialize["issuer"] = o.Issuer + } + if o.Modulus != nil { + toSerialize["modulus"] = o.Modulus + } + if o.Protocol != nil { + toSerialize["protocol"] = o.Protocol + } + if o.SerialNumber != nil { + toSerialize["serial_number"] = o.SerialNumber + } + if o.Subject != nil { + toSerialize["subject"] = o.Subject + } + if o.TlsVersion != nil { + toSerialize["tls_version"] = o.TlsVersion + } + if o.Valid != nil { + toSerialize["valid"] = o.Valid + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCertificate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cipher *string `json:"cipher,omitempty"` + Exponent *int64 `json:"exponent,omitempty"` + ExtKeyUsage []string `json:"ext_key_usage,omitempty"` + Fingerprint *string `json:"fingerprint,omitempty"` + Fingerprint256 *string `json:"fingerprint256,omitempty"` + Issuer map[string]string `json:"issuer,omitempty"` + Modulus *string `json:"modulus,omitempty"` + Protocol *string `json:"protocol,omitempty"` + SerialNumber *string `json:"serial_number,omitempty"` + Subject map[string]string `json:"subject,omitempty"` + TlsVersion *float64 `json:"tls_version,omitempty"` + Valid *SyntheticsTestResultCertificateValidity `json:"valid,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cipher", "exponent", "ext_key_usage", "fingerprint", "fingerprint256", "issuer", "modulus", "protocol", "serial_number", "subject", "tls_version", "valid"}) + } else { + return err + } + + hasInvalidField := false + o.Cipher = all.Cipher + o.Exponent = all.Exponent + o.ExtKeyUsage = all.ExtKeyUsage + o.Fingerprint = all.Fingerprint + o.Fingerprint256 = all.Fingerprint256 + o.Issuer = all.Issuer + o.Modulus = all.Modulus + o.Protocol = all.Protocol + o.SerialNumber = all.SerialNumber + o.Subject = all.Subject + o.TlsVersion = all.TlsVersion + if all.Valid != nil && all.Valid.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Valid = all.Valid + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_certificate_validity.go b/api/datadogV2/model_synthetics_test_result_certificate_validity.go new file mode 100644 index 00000000000..43f4e43a11e --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_certificate_validity.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCertificateValidity Validity window of a certificate. +type SyntheticsTestResultCertificateValidity struct { + // Unix timestamp (ms) of when the certificate became valid. + From *int64 `json:"from,omitempty"` + // Unix timestamp (ms) of when the certificate expires. + To *int64 `json:"to,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCertificateValidity instantiates a new SyntheticsTestResultCertificateValidity object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCertificateValidity() *SyntheticsTestResultCertificateValidity { + this := SyntheticsTestResultCertificateValidity{} + return &this +} + +// NewSyntheticsTestResultCertificateValidityWithDefaults instantiates a new SyntheticsTestResultCertificateValidity object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCertificateValidityWithDefaults() *SyntheticsTestResultCertificateValidity { + this := SyntheticsTestResultCertificateValidity{} + return &this +} + +// GetFrom returns the From field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificateValidity) GetFrom() int64 { + if o == nil || o.From == nil { + var ret int64 + return ret + } + return *o.From +} + +// GetFromOk returns a tuple with the From field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificateValidity) GetFromOk() (*int64, bool) { + if o == nil || o.From == nil { + return nil, false + } + return o.From, true +} + +// HasFrom returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificateValidity) HasFrom() bool { + return o != nil && o.From != nil +} + +// SetFrom gets a reference to the given int64 and assigns it to the From field. +func (o *SyntheticsTestResultCertificateValidity) SetFrom(v int64) { + o.From = &v +} + +// GetTo returns the To field value if set, zero value otherwise. +func (o *SyntheticsTestResultCertificateValidity) GetTo() int64 { + if o == nil || o.To == nil { + var ret int64 + return ret + } + return *o.To +} + +// GetToOk returns a tuple with the To field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCertificateValidity) GetToOk() (*int64, bool) { + if o == nil || o.To == nil { + return nil, false + } + return o.To, true +} + +// HasTo returns a boolean if a field has been set. +func (o *SyntheticsTestResultCertificateValidity) HasTo() bool { + return o != nil && o.To != nil +} + +// SetTo gets a reference to the given int64 and assigns it to the To field. +func (o *SyntheticsTestResultCertificateValidity) SetTo(v int64) { + o.To = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCertificateValidity) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.From != nil { + toSerialize["from"] = o.From + } + if o.To != nil { + toSerialize["to"] = o.To + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCertificateValidity) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + From *int64 `json:"from,omitempty"` + To *int64 `json:"to,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"from", "to"}) + } else { + return err + } + o.From = all.From + o.To = all.To + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ci.go b/api/datadogV2/model_synthetics_test_result_ci.go new file mode 100644 index 00000000000..ed29cb5e892 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ci.go @@ -0,0 +1,222 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCI CI information associated with the test result. +type SyntheticsTestResultCI struct { + // Details of the CI pipeline. + Pipeline *SyntheticsTestResultCIPipeline `json:"pipeline,omitempty"` + // Details of the CI provider. + Provider *SyntheticsTestResultCIProvider `json:"provider,omitempty"` + // Details of the CI stage. + Stage *SyntheticsTestResultCIStage `json:"stage,omitempty"` + // Path of the workspace that ran the CI job. + WorkspacePath *string `json:"workspace_path,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCI instantiates a new SyntheticsTestResultCI object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCI() *SyntheticsTestResultCI { + this := SyntheticsTestResultCI{} + return &this +} + +// NewSyntheticsTestResultCIWithDefaults instantiates a new SyntheticsTestResultCI object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCIWithDefaults() *SyntheticsTestResultCI { + this := SyntheticsTestResultCI{} + return &this +} + +// GetPipeline returns the Pipeline field value if set, zero value otherwise. +func (o *SyntheticsTestResultCI) GetPipeline() SyntheticsTestResultCIPipeline { + if o == nil || o.Pipeline == nil { + var ret SyntheticsTestResultCIPipeline + return ret + } + return *o.Pipeline +} + +// GetPipelineOk returns a tuple with the Pipeline field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCI) GetPipelineOk() (*SyntheticsTestResultCIPipeline, bool) { + if o == nil || o.Pipeline == nil { + return nil, false + } + return o.Pipeline, true +} + +// HasPipeline returns a boolean if a field has been set. +func (o *SyntheticsTestResultCI) HasPipeline() bool { + return o != nil && o.Pipeline != nil +} + +// SetPipeline gets a reference to the given SyntheticsTestResultCIPipeline and assigns it to the Pipeline field. +func (o *SyntheticsTestResultCI) SetPipeline(v SyntheticsTestResultCIPipeline) { + o.Pipeline = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *SyntheticsTestResultCI) GetProvider() SyntheticsTestResultCIProvider { + if o == nil || o.Provider == nil { + var ret SyntheticsTestResultCIProvider + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCI) GetProviderOk() (*SyntheticsTestResultCIProvider, bool) { + if o == nil || o.Provider == nil { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *SyntheticsTestResultCI) HasProvider() bool { + return o != nil && o.Provider != nil +} + +// SetProvider gets a reference to the given SyntheticsTestResultCIProvider and assigns it to the Provider field. +func (o *SyntheticsTestResultCI) SetProvider(v SyntheticsTestResultCIProvider) { + o.Provider = &v +} + +// GetStage returns the Stage field value if set, zero value otherwise. +func (o *SyntheticsTestResultCI) GetStage() SyntheticsTestResultCIStage { + if o == nil || o.Stage == nil { + var ret SyntheticsTestResultCIStage + return ret + } + return *o.Stage +} + +// GetStageOk returns a tuple with the Stage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCI) GetStageOk() (*SyntheticsTestResultCIStage, bool) { + if o == nil || o.Stage == nil { + return nil, false + } + return o.Stage, true +} + +// HasStage returns a boolean if a field has been set. +func (o *SyntheticsTestResultCI) HasStage() bool { + return o != nil && o.Stage != nil +} + +// SetStage gets a reference to the given SyntheticsTestResultCIStage and assigns it to the Stage field. +func (o *SyntheticsTestResultCI) SetStage(v SyntheticsTestResultCIStage) { + o.Stage = &v +} + +// GetWorkspacePath returns the WorkspacePath field value if set, zero value otherwise. +func (o *SyntheticsTestResultCI) GetWorkspacePath() string { + if o == nil || o.WorkspacePath == nil { + var ret string + return ret + } + return *o.WorkspacePath +} + +// GetWorkspacePathOk returns a tuple with the WorkspacePath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCI) GetWorkspacePathOk() (*string, bool) { + if o == nil || o.WorkspacePath == nil { + return nil, false + } + return o.WorkspacePath, true +} + +// HasWorkspacePath returns a boolean if a field has been set. +func (o *SyntheticsTestResultCI) HasWorkspacePath() bool { + return o != nil && o.WorkspacePath != nil +} + +// SetWorkspacePath gets a reference to the given string and assigns it to the WorkspacePath field. +func (o *SyntheticsTestResultCI) SetWorkspacePath(v string) { + o.WorkspacePath = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCI) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Pipeline != nil { + toSerialize["pipeline"] = o.Pipeline + } + if o.Provider != nil { + toSerialize["provider"] = o.Provider + } + if o.Stage != nil { + toSerialize["stage"] = o.Stage + } + if o.WorkspacePath != nil { + toSerialize["workspace_path"] = o.WorkspacePath + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCI) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Pipeline *SyntheticsTestResultCIPipeline `json:"pipeline,omitempty"` + Provider *SyntheticsTestResultCIProvider `json:"provider,omitempty"` + Stage *SyntheticsTestResultCIStage `json:"stage,omitempty"` + WorkspacePath *string `json:"workspace_path,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"pipeline", "provider", "stage", "workspace_path"}) + } else { + return err + } + + hasInvalidField := false + if all.Pipeline != nil && all.Pipeline.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Pipeline = all.Pipeline + if all.Provider != nil && all.Provider.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Provider = all.Provider + if all.Stage != nil && all.Stage.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Stage = all.Stage + o.WorkspacePath = all.WorkspacePath + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ci_pipeline.go b/api/datadogV2/model_synthetics_test_result_ci_pipeline.go new file mode 100644 index 00000000000..64a094a9750 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ci_pipeline.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCIPipeline Details of the CI pipeline. +type SyntheticsTestResultCIPipeline struct { + // Pipeline identifier. + Id *string `json:"id,omitempty"` + // Pipeline name. + Name *string `json:"name,omitempty"` + // Pipeline number. + Number *int64 `json:"number,omitempty"` + // Pipeline URL. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCIPipeline instantiates a new SyntheticsTestResultCIPipeline object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCIPipeline() *SyntheticsTestResultCIPipeline { + this := SyntheticsTestResultCIPipeline{} + return &this +} + +// NewSyntheticsTestResultCIPipelineWithDefaults instantiates a new SyntheticsTestResultCIPipeline object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCIPipelineWithDefaults() *SyntheticsTestResultCIPipeline { + this := SyntheticsTestResultCIPipeline{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIPipeline) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIPipeline) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIPipeline) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultCIPipeline) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIPipeline) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIPipeline) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIPipeline) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultCIPipeline) SetName(v string) { + o.Name = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIPipeline) GetNumber() int64 { + if o == nil || o.Number == nil { + var ret int64 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIPipeline) GetNumberOk() (*int64, bool) { + if o == nil || o.Number == nil { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIPipeline) HasNumber() bool { + return o != nil && o.Number != nil +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *SyntheticsTestResultCIPipeline) SetNumber(v int64) { + o.Number = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIPipeline) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIPipeline) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIPipeline) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultCIPipeline) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCIPipeline) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCIPipeline) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Number *int64 `json:"number,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "name", "number", "url"}) + } else { + return err + } + o.Id = all.Id + o.Name = all.Name + o.Number = all.Number + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ci_provider.go b/api/datadogV2/model_synthetics_test_result_ci_provider.go new file mode 100644 index 00000000000..9d485f7968c --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ci_provider.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCIProvider Details of the CI provider. +type SyntheticsTestResultCIProvider struct { + // Provider name. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCIProvider instantiates a new SyntheticsTestResultCIProvider object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCIProvider() *SyntheticsTestResultCIProvider { + this := SyntheticsTestResultCIProvider{} + return &this +} + +// NewSyntheticsTestResultCIProviderWithDefaults instantiates a new SyntheticsTestResultCIProvider object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCIProviderWithDefaults() *SyntheticsTestResultCIProvider { + this := SyntheticsTestResultCIProvider{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIProvider) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIProvider) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIProvider) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultCIProvider) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCIProvider) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCIProvider) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name"}) + } else { + return err + } + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ci_stage.go b/api/datadogV2/model_synthetics_test_result_ci_stage.go new file mode 100644 index 00000000000..40a29c04ab1 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ci_stage.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultCIStage Details of the CI stage. +type SyntheticsTestResultCIStage struct { + // Stage name. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultCIStage instantiates a new SyntheticsTestResultCIStage object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultCIStage() *SyntheticsTestResultCIStage { + this := SyntheticsTestResultCIStage{} + return &this +} + +// NewSyntheticsTestResultCIStageWithDefaults instantiates a new SyntheticsTestResultCIStage object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultCIStageWithDefaults() *SyntheticsTestResultCIStage { + this := SyntheticsTestResultCIStage{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultCIStage) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultCIStage) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultCIStage) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultCIStage) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultCIStage) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultCIStage) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name"}) + } else { + return err + } + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_data.go b/api/datadogV2/model_synthetics_test_result_data.go new file mode 100644 index 00000000000..e1d5fdba7a8 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_data.go @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultData Wrapper object for a Synthetic test result. +type SyntheticsTestResultData struct { + // Attributes of a Synthetic test result. + Attributes *SyntheticsTestResultAttributes `json:"attributes,omitempty"` + // The result ID. + Id *string `json:"id,omitempty"` + // Relationships for a Synthetic test result. + Relationships *SyntheticsTestResultRelationships `json:"relationships,omitempty"` + // Type of the Synthetic test result resource, `result`. + Type *SyntheticsTestResultType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultData instantiates a new SyntheticsTestResultData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultData() *SyntheticsTestResultData { + this := SyntheticsTestResultData{} + var typeVar SyntheticsTestResultType = SYNTHETICSTESTRESULTTYPE_RESULT + this.Type = &typeVar + return &this +} + +// NewSyntheticsTestResultDataWithDefaults instantiates a new SyntheticsTestResultData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDataWithDefaults() *SyntheticsTestResultData { + this := SyntheticsTestResultData{} + var typeVar SyntheticsTestResultType = SYNTHETICSTESTRESULTTYPE_RESULT + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SyntheticsTestResultData) GetAttributes() SyntheticsTestResultAttributes { + if o == nil || o.Attributes == nil { + var ret SyntheticsTestResultAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultData) GetAttributesOk() (*SyntheticsTestResultAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SyntheticsTestResultData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given SyntheticsTestResultAttributes and assigns it to the Attributes field. +func (o *SyntheticsTestResultData) SetAttributes(v SyntheticsTestResultAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultData) SetId(v string) { + o.Id = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *SyntheticsTestResultData) GetRelationships() SyntheticsTestResultRelationships { + if o == nil || o.Relationships == nil { + var ret SyntheticsTestResultRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultData) GetRelationshipsOk() (*SyntheticsTestResultRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *SyntheticsTestResultData) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given SyntheticsTestResultRelationships and assigns it to the Relationships field. +func (o *SyntheticsTestResultData) SetRelationships(v SyntheticsTestResultRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultData) GetType() SyntheticsTestResultType { + if o == nil || o.Type == nil { + var ret SyntheticsTestResultType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultData) GetTypeOk() (*SyntheticsTestResultType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given SyntheticsTestResultType and assigns it to the Type field. +func (o *SyntheticsTestResultData) SetType(v SyntheticsTestResultType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SyntheticsTestResultAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Relationships *SyntheticsTestResultRelationships `json:"relationships,omitempty"` + Type *SyntheticsTestResultType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_detail.go b/api/datadogV2/model_synthetics_test_result_detail.go new file mode 100644 index 00000000000..43a2788a6ab --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_detail.go @@ -0,0 +1,1555 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDetail Full result details for a Synthetic test execution. +type SyntheticsTestResultDetail struct { + // Assertion results produced by the test. + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` + // Storage bucket keys for artifacts produced during a step or test. + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + // gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + CallType *string `json:"call_type,omitempty"` + // SSL/TLS certificate information returned from an SSL test. + Cert *SyntheticsTestResultCertificate `json:"cert,omitempty"` + // Compressed JSON descriptor for the test (internal format). + CompressedJsonDescriptor *string `json:"compressed_json_descriptor,omitempty"` + // Compressed representation of the test steps (internal format). + CompressedSteps *string `json:"compressed_steps,omitempty"` + // Outcome of the connection attempt (for example, `established`, `refused`). + ConnectionOutcome *string `json:"connection_outcome,omitempty"` + // DNS resolution details recorded during the test execution. + DnsResolution *SyntheticsTestResultDnsResolution `json:"dns_resolution,omitempty"` + // Duration of the test execution (in milliseconds). + Duration *float64 `json:"duration,omitempty"` + // Whether the test exited early because a step marked with `exitIfSucceed` passed. + ExitedOnStepSuccess *bool `json:"exited_on_step_success,omitempty"` + // Details about the failure of a Synthetic test. + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` + // Timestamp of when the test finished (in milliseconds). + FinishedAt *int64 `json:"finished_at,omitempty"` + // Handshake request and response for protocol-level tests. + Handshake *SyntheticsTestResultHandshake `json:"handshake,omitempty"` + // The unique identifier for this result. + Id *string `json:"id,omitempty"` + // The initial result ID before any retries. + InitialId *string `json:"initial_id,omitempty"` + // Whether this result is from a fast retry. + IsFastRetry *bool `json:"is_fast_retry,omitempty"` + // Whether this result is from the last retry. + IsLastRetry *bool `json:"is_last_retry,omitempty"` + // Network Path test result capturing the path between source and destination. + Netpath *SyntheticsTestResultNetpath `json:"netpath,omitempty"` + // Aggregated network statistics from the test execution. + Netstats *SyntheticsTestResultNetstats `json:"netstats,omitempty"` + // OCSP response received while validating a certificate. + Ocsp *SyntheticsTestResultOCSPResponse `json:"ocsp,omitempty"` + // A network probe result, used for traceroute hops and ping summaries. + Ping *SyntheticsTestResultTracerouteHop `json:"ping,omitempty"` + // Number of emails received during the test (email tests). + ReceivedEmailCount *int64 `json:"received_email_count,omitempty"` + // Message received from the target (for WebSocket/TCP/UDP tests). + ReceivedMessage *string `json:"received_message,omitempty"` + // Details of the outgoing request made during the test execution. + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + // IP address resolved for the target host. + ResolvedIp *string `json:"resolved_ip,omitempty"` + // Details of the response received during the test execution. + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + // The type of run for a Synthetic test result. + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` + // Message sent to the target (for WebSocket/TCP/UDP tests). + SentMessage *string `json:"sent_message,omitempty"` + // Start URL for the test (browser tests). + StartUrl *string `json:"start_url,omitempty"` + // Timestamp of when the test started (in milliseconds). + StartedAt *int64 `json:"started_at,omitempty"` + // Status of a Synthetic test result. + Status *SyntheticsTestResultStatus `json:"status,omitempty"` + // Step results (for browser, mobile, and multistep API tests). + Steps []SyntheticsTestResultStep `json:"steps,omitempty"` + // Time to interactive in milliseconds (browser tests). + TimeToInteractive *int64 `json:"time_to_interactive,omitempty"` + // Timing breakdown of the test request phases (for example, DNS, TCP, TLS, first byte). + Timings map[string]interface{} `json:"timings,omitempty"` + // Trace identifiers associated with a Synthetic test result. + Trace *SyntheticsTestResultTrace `json:"trace,omitempty"` + // Traceroute hop results (for network tests). + Traceroute []SyntheticsTestResultTracerouteHop `json:"traceroute,omitempty"` + // Timestamp of when the test was triggered (in milliseconds). + TriggeredAt *int64 `json:"triggered_at,omitempty"` + // Whether the test was executed through a tunnel. + Tunnel *bool `json:"tunnel,omitempty"` + // Turns executed by a goal-based browser test. + Turns []SyntheticsTestResultTurn `json:"turns,omitempty"` + // Whether the test runner was unhealthy at the time of execution. + Unhealthy *bool `json:"unhealthy,omitempty"` + // Variables captured during a test step. + Variables *SyntheticsTestResultVariables `json:"variables,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDetail instantiates a new SyntheticsTestResultDetail object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDetail() *SyntheticsTestResultDetail { + this := SyntheticsTestResultDetail{} + return &this +} + +// NewSyntheticsTestResultDetailWithDefaults instantiates a new SyntheticsTestResultDetail object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDetailWithDefaults() *SyntheticsTestResultDetail { + this := SyntheticsTestResultDetail{} + return &this +} + +// GetAssertions returns the Assertions field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetAssertions() []SyntheticsTestResultAssertionResult { + if o == nil || o.Assertions == nil { + var ret []SyntheticsTestResultAssertionResult + return ret + } + return o.Assertions +} + +// GetAssertionsOk returns a tuple with the Assertions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetAssertionsOk() (*[]SyntheticsTestResultAssertionResult, bool) { + if o == nil || o.Assertions == nil { + return nil, false + } + return &o.Assertions, true +} + +// HasAssertions returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasAssertions() bool { + return o != nil && o.Assertions != nil +} + +// SetAssertions gets a reference to the given []SyntheticsTestResultAssertionResult and assigns it to the Assertions field. +func (o *SyntheticsTestResultDetail) SetAssertions(v []SyntheticsTestResultAssertionResult) { + o.Assertions = v +} + +// GetBucketKeys returns the BucketKeys field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetBucketKeys() SyntheticsTestResultBucketKeys { + if o == nil || o.BucketKeys == nil { + var ret SyntheticsTestResultBucketKeys + return ret + } + return *o.BucketKeys +} + +// GetBucketKeysOk returns a tuple with the BucketKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetBucketKeysOk() (*SyntheticsTestResultBucketKeys, bool) { + if o == nil || o.BucketKeys == nil { + return nil, false + } + return o.BucketKeys, true +} + +// HasBucketKeys returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasBucketKeys() bool { + return o != nil && o.BucketKeys != nil +} + +// SetBucketKeys gets a reference to the given SyntheticsTestResultBucketKeys and assigns it to the BucketKeys field. +func (o *SyntheticsTestResultDetail) SetBucketKeys(v SyntheticsTestResultBucketKeys) { + o.BucketKeys = &v +} + +// GetCallType returns the CallType field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetCallType() string { + if o == nil || o.CallType == nil { + var ret string + return ret + } + return *o.CallType +} + +// GetCallTypeOk returns a tuple with the CallType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetCallTypeOk() (*string, bool) { + if o == nil || o.CallType == nil { + return nil, false + } + return o.CallType, true +} + +// HasCallType returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasCallType() bool { + return o != nil && o.CallType != nil +} + +// SetCallType gets a reference to the given string and assigns it to the CallType field. +func (o *SyntheticsTestResultDetail) SetCallType(v string) { + o.CallType = &v +} + +// GetCert returns the Cert field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetCert() SyntheticsTestResultCertificate { + if o == nil || o.Cert == nil { + var ret SyntheticsTestResultCertificate + return ret + } + return *o.Cert +} + +// GetCertOk returns a tuple with the Cert field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetCertOk() (*SyntheticsTestResultCertificate, bool) { + if o == nil || o.Cert == nil { + return nil, false + } + return o.Cert, true +} + +// HasCert returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasCert() bool { + return o != nil && o.Cert != nil +} + +// SetCert gets a reference to the given SyntheticsTestResultCertificate and assigns it to the Cert field. +func (o *SyntheticsTestResultDetail) SetCert(v SyntheticsTestResultCertificate) { + o.Cert = &v +} + +// GetCompressedJsonDescriptor returns the CompressedJsonDescriptor field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetCompressedJsonDescriptor() string { + if o == nil || o.CompressedJsonDescriptor == nil { + var ret string + return ret + } + return *o.CompressedJsonDescriptor +} + +// GetCompressedJsonDescriptorOk returns a tuple with the CompressedJsonDescriptor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetCompressedJsonDescriptorOk() (*string, bool) { + if o == nil || o.CompressedJsonDescriptor == nil { + return nil, false + } + return o.CompressedJsonDescriptor, true +} + +// HasCompressedJsonDescriptor returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasCompressedJsonDescriptor() bool { + return o != nil && o.CompressedJsonDescriptor != nil +} + +// SetCompressedJsonDescriptor gets a reference to the given string and assigns it to the CompressedJsonDescriptor field. +func (o *SyntheticsTestResultDetail) SetCompressedJsonDescriptor(v string) { + o.CompressedJsonDescriptor = &v +} + +// GetCompressedSteps returns the CompressedSteps field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetCompressedSteps() string { + if o == nil || o.CompressedSteps == nil { + var ret string + return ret + } + return *o.CompressedSteps +} + +// GetCompressedStepsOk returns a tuple with the CompressedSteps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetCompressedStepsOk() (*string, bool) { + if o == nil || o.CompressedSteps == nil { + return nil, false + } + return o.CompressedSteps, true +} + +// HasCompressedSteps returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasCompressedSteps() bool { + return o != nil && o.CompressedSteps != nil +} + +// SetCompressedSteps gets a reference to the given string and assigns it to the CompressedSteps field. +func (o *SyntheticsTestResultDetail) SetCompressedSteps(v string) { + o.CompressedSteps = &v +} + +// GetConnectionOutcome returns the ConnectionOutcome field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetConnectionOutcome() string { + if o == nil || o.ConnectionOutcome == nil { + var ret string + return ret + } + return *o.ConnectionOutcome +} + +// GetConnectionOutcomeOk returns a tuple with the ConnectionOutcome field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetConnectionOutcomeOk() (*string, bool) { + if o == nil || o.ConnectionOutcome == nil { + return nil, false + } + return o.ConnectionOutcome, true +} + +// HasConnectionOutcome returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasConnectionOutcome() bool { + return o != nil && o.ConnectionOutcome != nil +} + +// SetConnectionOutcome gets a reference to the given string and assigns it to the ConnectionOutcome field. +func (o *SyntheticsTestResultDetail) SetConnectionOutcome(v string) { + o.ConnectionOutcome = &v +} + +// GetDnsResolution returns the DnsResolution field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetDnsResolution() SyntheticsTestResultDnsResolution { + if o == nil || o.DnsResolution == nil { + var ret SyntheticsTestResultDnsResolution + return ret + } + return *o.DnsResolution +} + +// GetDnsResolutionOk returns a tuple with the DnsResolution field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetDnsResolutionOk() (*SyntheticsTestResultDnsResolution, bool) { + if o == nil || o.DnsResolution == nil { + return nil, false + } + return o.DnsResolution, true +} + +// HasDnsResolution returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasDnsResolution() bool { + return o != nil && o.DnsResolution != nil +} + +// SetDnsResolution gets a reference to the given SyntheticsTestResultDnsResolution and assigns it to the DnsResolution field. +func (o *SyntheticsTestResultDetail) SetDnsResolution(v SyntheticsTestResultDnsResolution) { + o.DnsResolution = &v +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetDuration() float64 { + if o == nil || o.Duration == nil { + var ret float64 + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetDurationOk() (*float64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given float64 and assigns it to the Duration field. +func (o *SyntheticsTestResultDetail) SetDuration(v float64) { + o.Duration = &v +} + +// GetExitedOnStepSuccess returns the ExitedOnStepSuccess field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetExitedOnStepSuccess() bool { + if o == nil || o.ExitedOnStepSuccess == nil { + var ret bool + return ret + } + return *o.ExitedOnStepSuccess +} + +// GetExitedOnStepSuccessOk returns a tuple with the ExitedOnStepSuccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetExitedOnStepSuccessOk() (*bool, bool) { + if o == nil || o.ExitedOnStepSuccess == nil { + return nil, false + } + return o.ExitedOnStepSuccess, true +} + +// HasExitedOnStepSuccess returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasExitedOnStepSuccess() bool { + return o != nil && o.ExitedOnStepSuccess != nil +} + +// SetExitedOnStepSuccess gets a reference to the given bool and assigns it to the ExitedOnStepSuccess field. +func (o *SyntheticsTestResultDetail) SetExitedOnStepSuccess(v bool) { + o.ExitedOnStepSuccess = &v +} + +// GetFailure returns the Failure field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetFailure() SyntheticsTestResultFailure { + if o == nil || o.Failure == nil { + var ret SyntheticsTestResultFailure + return ret + } + return *o.Failure +} + +// GetFailureOk returns a tuple with the Failure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetFailureOk() (*SyntheticsTestResultFailure, bool) { + if o == nil || o.Failure == nil { + return nil, false + } + return o.Failure, true +} + +// HasFailure returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasFailure() bool { + return o != nil && o.Failure != nil +} + +// SetFailure gets a reference to the given SyntheticsTestResultFailure and assigns it to the Failure field. +func (o *SyntheticsTestResultDetail) SetFailure(v SyntheticsTestResultFailure) { + o.Failure = &v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetFinishedAt() int64 { + if o == nil || o.FinishedAt == nil { + var ret int64 + return ret + } + return *o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetFinishedAtOk() (*int64, bool) { + if o == nil || o.FinishedAt == nil { + return nil, false + } + return o.FinishedAt, true +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasFinishedAt() bool { + return o != nil && o.FinishedAt != nil +} + +// SetFinishedAt gets a reference to the given int64 and assigns it to the FinishedAt field. +func (o *SyntheticsTestResultDetail) SetFinishedAt(v int64) { + o.FinishedAt = &v +} + +// GetHandshake returns the Handshake field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetHandshake() SyntheticsTestResultHandshake { + if o == nil || o.Handshake == nil { + var ret SyntheticsTestResultHandshake + return ret + } + return *o.Handshake +} + +// GetHandshakeOk returns a tuple with the Handshake field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetHandshakeOk() (*SyntheticsTestResultHandshake, bool) { + if o == nil || o.Handshake == nil { + return nil, false + } + return o.Handshake, true +} + +// HasHandshake returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasHandshake() bool { + return o != nil && o.Handshake != nil +} + +// SetHandshake gets a reference to the given SyntheticsTestResultHandshake and assigns it to the Handshake field. +func (o *SyntheticsTestResultDetail) SetHandshake(v SyntheticsTestResultHandshake) { + o.Handshake = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultDetail) SetId(v string) { + o.Id = &v +} + +// GetInitialId returns the InitialId field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetInitialId() string { + if o == nil || o.InitialId == nil { + var ret string + return ret + } + return *o.InitialId +} + +// GetInitialIdOk returns a tuple with the InitialId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetInitialIdOk() (*string, bool) { + if o == nil || o.InitialId == nil { + return nil, false + } + return o.InitialId, true +} + +// HasInitialId returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasInitialId() bool { + return o != nil && o.InitialId != nil +} + +// SetInitialId gets a reference to the given string and assigns it to the InitialId field. +func (o *SyntheticsTestResultDetail) SetInitialId(v string) { + o.InitialId = &v +} + +// GetIsFastRetry returns the IsFastRetry field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetIsFastRetry() bool { + if o == nil || o.IsFastRetry == nil { + var ret bool + return ret + } + return *o.IsFastRetry +} + +// GetIsFastRetryOk returns a tuple with the IsFastRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetIsFastRetryOk() (*bool, bool) { + if o == nil || o.IsFastRetry == nil { + return nil, false + } + return o.IsFastRetry, true +} + +// HasIsFastRetry returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasIsFastRetry() bool { + return o != nil && o.IsFastRetry != nil +} + +// SetIsFastRetry gets a reference to the given bool and assigns it to the IsFastRetry field. +func (o *SyntheticsTestResultDetail) SetIsFastRetry(v bool) { + o.IsFastRetry = &v +} + +// GetIsLastRetry returns the IsLastRetry field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetIsLastRetry() bool { + if o == nil || o.IsLastRetry == nil { + var ret bool + return ret + } + return *o.IsLastRetry +} + +// GetIsLastRetryOk returns a tuple with the IsLastRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetIsLastRetryOk() (*bool, bool) { + if o == nil || o.IsLastRetry == nil { + return nil, false + } + return o.IsLastRetry, true +} + +// HasIsLastRetry returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasIsLastRetry() bool { + return o != nil && o.IsLastRetry != nil +} + +// SetIsLastRetry gets a reference to the given bool and assigns it to the IsLastRetry field. +func (o *SyntheticsTestResultDetail) SetIsLastRetry(v bool) { + o.IsLastRetry = &v +} + +// GetNetpath returns the Netpath field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetNetpath() SyntheticsTestResultNetpath { + if o == nil || o.Netpath == nil { + var ret SyntheticsTestResultNetpath + return ret + } + return *o.Netpath +} + +// GetNetpathOk returns a tuple with the Netpath field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetNetpathOk() (*SyntheticsTestResultNetpath, bool) { + if o == nil || o.Netpath == nil { + return nil, false + } + return o.Netpath, true +} + +// HasNetpath returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasNetpath() bool { + return o != nil && o.Netpath != nil +} + +// SetNetpath gets a reference to the given SyntheticsTestResultNetpath and assigns it to the Netpath field. +func (o *SyntheticsTestResultDetail) SetNetpath(v SyntheticsTestResultNetpath) { + o.Netpath = &v +} + +// GetNetstats returns the Netstats field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetNetstats() SyntheticsTestResultNetstats { + if o == nil || o.Netstats == nil { + var ret SyntheticsTestResultNetstats + return ret + } + return *o.Netstats +} + +// GetNetstatsOk returns a tuple with the Netstats field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetNetstatsOk() (*SyntheticsTestResultNetstats, bool) { + if o == nil || o.Netstats == nil { + return nil, false + } + return o.Netstats, true +} + +// HasNetstats returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasNetstats() bool { + return o != nil && o.Netstats != nil +} + +// SetNetstats gets a reference to the given SyntheticsTestResultNetstats and assigns it to the Netstats field. +func (o *SyntheticsTestResultDetail) SetNetstats(v SyntheticsTestResultNetstats) { + o.Netstats = &v +} + +// GetOcsp returns the Ocsp field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetOcsp() SyntheticsTestResultOCSPResponse { + if o == nil || o.Ocsp == nil { + var ret SyntheticsTestResultOCSPResponse + return ret + } + return *o.Ocsp +} + +// GetOcspOk returns a tuple with the Ocsp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetOcspOk() (*SyntheticsTestResultOCSPResponse, bool) { + if o == nil || o.Ocsp == nil { + return nil, false + } + return o.Ocsp, true +} + +// HasOcsp returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasOcsp() bool { + return o != nil && o.Ocsp != nil +} + +// SetOcsp gets a reference to the given SyntheticsTestResultOCSPResponse and assigns it to the Ocsp field. +func (o *SyntheticsTestResultDetail) SetOcsp(v SyntheticsTestResultOCSPResponse) { + o.Ocsp = &v +} + +// GetPing returns the Ping field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetPing() SyntheticsTestResultTracerouteHop { + if o == nil || o.Ping == nil { + var ret SyntheticsTestResultTracerouteHop + return ret + } + return *o.Ping +} + +// GetPingOk returns a tuple with the Ping field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetPingOk() (*SyntheticsTestResultTracerouteHop, bool) { + if o == nil || o.Ping == nil { + return nil, false + } + return o.Ping, true +} + +// HasPing returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasPing() bool { + return o != nil && o.Ping != nil +} + +// SetPing gets a reference to the given SyntheticsTestResultTracerouteHop and assigns it to the Ping field. +func (o *SyntheticsTestResultDetail) SetPing(v SyntheticsTestResultTracerouteHop) { + o.Ping = &v +} + +// GetReceivedEmailCount returns the ReceivedEmailCount field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetReceivedEmailCount() int64 { + if o == nil || o.ReceivedEmailCount == nil { + var ret int64 + return ret + } + return *o.ReceivedEmailCount +} + +// GetReceivedEmailCountOk returns a tuple with the ReceivedEmailCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetReceivedEmailCountOk() (*int64, bool) { + if o == nil || o.ReceivedEmailCount == nil { + return nil, false + } + return o.ReceivedEmailCount, true +} + +// HasReceivedEmailCount returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasReceivedEmailCount() bool { + return o != nil && o.ReceivedEmailCount != nil +} + +// SetReceivedEmailCount gets a reference to the given int64 and assigns it to the ReceivedEmailCount field. +func (o *SyntheticsTestResultDetail) SetReceivedEmailCount(v int64) { + o.ReceivedEmailCount = &v +} + +// GetReceivedMessage returns the ReceivedMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetReceivedMessage() string { + if o == nil || o.ReceivedMessage == nil { + var ret string + return ret + } + return *o.ReceivedMessage +} + +// GetReceivedMessageOk returns a tuple with the ReceivedMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetReceivedMessageOk() (*string, bool) { + if o == nil || o.ReceivedMessage == nil { + return nil, false + } + return o.ReceivedMessage, true +} + +// HasReceivedMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasReceivedMessage() bool { + return o != nil && o.ReceivedMessage != nil +} + +// SetReceivedMessage gets a reference to the given string and assigns it to the ReceivedMessage field. +func (o *SyntheticsTestResultDetail) SetReceivedMessage(v string) { + o.ReceivedMessage = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetRequest() SyntheticsTestResultRequestInfo { + if o == nil || o.Request == nil { + var ret SyntheticsTestResultRequestInfo + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetRequestOk() (*SyntheticsTestResultRequestInfo, bool) { + if o == nil || o.Request == nil { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasRequest() bool { + return o != nil && o.Request != nil +} + +// SetRequest gets a reference to the given SyntheticsTestResultRequestInfo and assigns it to the Request field. +func (o *SyntheticsTestResultDetail) SetRequest(v SyntheticsTestResultRequestInfo) { + o.Request = &v +} + +// GetResolvedIp returns the ResolvedIp field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetResolvedIp() string { + if o == nil || o.ResolvedIp == nil { + var ret string + return ret + } + return *o.ResolvedIp +} + +// GetResolvedIpOk returns a tuple with the ResolvedIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetResolvedIpOk() (*string, bool) { + if o == nil || o.ResolvedIp == nil { + return nil, false + } + return o.ResolvedIp, true +} + +// HasResolvedIp returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasResolvedIp() bool { + return o != nil && o.ResolvedIp != nil +} + +// SetResolvedIp gets a reference to the given string and assigns it to the ResolvedIp field. +func (o *SyntheticsTestResultDetail) SetResolvedIp(v string) { + o.ResolvedIp = &v +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetResponse() SyntheticsTestResultResponseInfo { + if o == nil || o.Response == nil { + var ret SyntheticsTestResultResponseInfo + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetResponseOk() (*SyntheticsTestResultResponseInfo, bool) { + if o == nil || o.Response == nil { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasResponse() bool { + return o != nil && o.Response != nil +} + +// SetResponse gets a reference to the given SyntheticsTestResultResponseInfo and assigns it to the Response field. +func (o *SyntheticsTestResultDetail) SetResponse(v SyntheticsTestResultResponseInfo) { + o.Response = &v +} + +// GetRunType returns the RunType field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetRunType() SyntheticsTestResultRunType { + if o == nil || o.RunType == nil { + var ret SyntheticsTestResultRunType + return ret + } + return *o.RunType +} + +// GetRunTypeOk returns a tuple with the RunType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetRunTypeOk() (*SyntheticsTestResultRunType, bool) { + if o == nil || o.RunType == nil { + return nil, false + } + return o.RunType, true +} + +// HasRunType returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasRunType() bool { + return o != nil && o.RunType != nil +} + +// SetRunType gets a reference to the given SyntheticsTestResultRunType and assigns it to the RunType field. +func (o *SyntheticsTestResultDetail) SetRunType(v SyntheticsTestResultRunType) { + o.RunType = &v +} + +// GetSentMessage returns the SentMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetSentMessage() string { + if o == nil || o.SentMessage == nil { + var ret string + return ret + } + return *o.SentMessage +} + +// GetSentMessageOk returns a tuple with the SentMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetSentMessageOk() (*string, bool) { + if o == nil || o.SentMessage == nil { + return nil, false + } + return o.SentMessage, true +} + +// HasSentMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasSentMessage() bool { + return o != nil && o.SentMessage != nil +} + +// SetSentMessage gets a reference to the given string and assigns it to the SentMessage field. +func (o *SyntheticsTestResultDetail) SetSentMessage(v string) { + o.SentMessage = &v +} + +// GetStartUrl returns the StartUrl field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetStartUrl() string { + if o == nil || o.StartUrl == nil { + var ret string + return ret + } + return *o.StartUrl +} + +// GetStartUrlOk returns a tuple with the StartUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetStartUrlOk() (*string, bool) { + if o == nil || o.StartUrl == nil { + return nil, false + } + return o.StartUrl, true +} + +// HasStartUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasStartUrl() bool { + return o != nil && o.StartUrl != nil +} + +// SetStartUrl gets a reference to the given string and assigns it to the StartUrl field. +func (o *SyntheticsTestResultDetail) SetStartUrl(v string) { + o.StartUrl = &v +} + +// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetStartedAt() int64 { + if o == nil || o.StartedAt == nil { + var ret int64 + return ret + } + return *o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetStartedAtOk() (*int64, bool) { + if o == nil || o.StartedAt == nil { + return nil, false + } + return o.StartedAt, true +} + +// HasStartedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasStartedAt() bool { + return o != nil && o.StartedAt != nil +} + +// SetStartedAt gets a reference to the given int64 and assigns it to the StartedAt field. +func (o *SyntheticsTestResultDetail) SetStartedAt(v int64) { + o.StartedAt = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetStatus() SyntheticsTestResultStatus { + if o == nil || o.Status == nil { + var ret SyntheticsTestResultStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetStatusOk() (*SyntheticsTestResultStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given SyntheticsTestResultStatus and assigns it to the Status field. +func (o *SyntheticsTestResultDetail) SetStatus(v SyntheticsTestResultStatus) { + o.Status = &v +} + +// GetSteps returns the Steps field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetSteps() []SyntheticsTestResultStep { + if o == nil || o.Steps == nil { + var ret []SyntheticsTestResultStep + return ret + } + return o.Steps +} + +// GetStepsOk returns a tuple with the Steps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetStepsOk() (*[]SyntheticsTestResultStep, bool) { + if o == nil || o.Steps == nil { + return nil, false + } + return &o.Steps, true +} + +// HasSteps returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasSteps() bool { + return o != nil && o.Steps != nil +} + +// SetSteps gets a reference to the given []SyntheticsTestResultStep and assigns it to the Steps field. +func (o *SyntheticsTestResultDetail) SetSteps(v []SyntheticsTestResultStep) { + o.Steps = v +} + +// GetTimeToInteractive returns the TimeToInteractive field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTimeToInteractive() int64 { + if o == nil || o.TimeToInteractive == nil { + var ret int64 + return ret + } + return *o.TimeToInteractive +} + +// GetTimeToInteractiveOk returns a tuple with the TimeToInteractive field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTimeToInteractiveOk() (*int64, bool) { + if o == nil || o.TimeToInteractive == nil { + return nil, false + } + return o.TimeToInteractive, true +} + +// HasTimeToInteractive returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTimeToInteractive() bool { + return o != nil && o.TimeToInteractive != nil +} + +// SetTimeToInteractive gets a reference to the given int64 and assigns it to the TimeToInteractive field. +func (o *SyntheticsTestResultDetail) SetTimeToInteractive(v int64) { + o.TimeToInteractive = &v +} + +// GetTimings returns the Timings field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTimings() map[string]interface{} { + if o == nil || o.Timings == nil { + var ret map[string]interface{} + return ret + } + return o.Timings +} + +// GetTimingsOk returns a tuple with the Timings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTimingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Timings == nil { + return nil, false + } + return &o.Timings, true +} + +// HasTimings returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTimings() bool { + return o != nil && o.Timings != nil +} + +// SetTimings gets a reference to the given map[string]interface{} and assigns it to the Timings field. +func (o *SyntheticsTestResultDetail) SetTimings(v map[string]interface{}) { + o.Timings = v +} + +// GetTrace returns the Trace field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTrace() SyntheticsTestResultTrace { + if o == nil || o.Trace == nil { + var ret SyntheticsTestResultTrace + return ret + } + return *o.Trace +} + +// GetTraceOk returns a tuple with the Trace field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTraceOk() (*SyntheticsTestResultTrace, bool) { + if o == nil || o.Trace == nil { + return nil, false + } + return o.Trace, true +} + +// HasTrace returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTrace() bool { + return o != nil && o.Trace != nil +} + +// SetTrace gets a reference to the given SyntheticsTestResultTrace and assigns it to the Trace field. +func (o *SyntheticsTestResultDetail) SetTrace(v SyntheticsTestResultTrace) { + o.Trace = &v +} + +// GetTraceroute returns the Traceroute field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTraceroute() []SyntheticsTestResultTracerouteHop { + if o == nil || o.Traceroute == nil { + var ret []SyntheticsTestResultTracerouteHop + return ret + } + return o.Traceroute +} + +// GetTracerouteOk returns a tuple with the Traceroute field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTracerouteOk() (*[]SyntheticsTestResultTracerouteHop, bool) { + if o == nil || o.Traceroute == nil { + return nil, false + } + return &o.Traceroute, true +} + +// HasTraceroute returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTraceroute() bool { + return o != nil && o.Traceroute != nil +} + +// SetTraceroute gets a reference to the given []SyntheticsTestResultTracerouteHop and assigns it to the Traceroute field. +func (o *SyntheticsTestResultDetail) SetTraceroute(v []SyntheticsTestResultTracerouteHop) { + o.Traceroute = v +} + +// GetTriggeredAt returns the TriggeredAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTriggeredAt() int64 { + if o == nil || o.TriggeredAt == nil { + var ret int64 + return ret + } + return *o.TriggeredAt +} + +// GetTriggeredAtOk returns a tuple with the TriggeredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTriggeredAtOk() (*int64, bool) { + if o == nil || o.TriggeredAt == nil { + return nil, false + } + return o.TriggeredAt, true +} + +// HasTriggeredAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTriggeredAt() bool { + return o != nil && o.TriggeredAt != nil +} + +// SetTriggeredAt gets a reference to the given int64 and assigns it to the TriggeredAt field. +func (o *SyntheticsTestResultDetail) SetTriggeredAt(v int64) { + o.TriggeredAt = &v +} + +// GetTunnel returns the Tunnel field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTunnel() bool { + if o == nil || o.Tunnel == nil { + var ret bool + return ret + } + return *o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTunnelOk() (*bool, bool) { + if o == nil || o.Tunnel == nil { + return nil, false + } + return o.Tunnel, true +} + +// HasTunnel returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTunnel() bool { + return o != nil && o.Tunnel != nil +} + +// SetTunnel gets a reference to the given bool and assigns it to the Tunnel field. +func (o *SyntheticsTestResultDetail) SetTunnel(v bool) { + o.Tunnel = &v +} + +// GetTurns returns the Turns field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetTurns() []SyntheticsTestResultTurn { + if o == nil || o.Turns == nil { + var ret []SyntheticsTestResultTurn + return ret + } + return o.Turns +} + +// GetTurnsOk returns a tuple with the Turns field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetTurnsOk() (*[]SyntheticsTestResultTurn, bool) { + if o == nil || o.Turns == nil { + return nil, false + } + return &o.Turns, true +} + +// HasTurns returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasTurns() bool { + return o != nil && o.Turns != nil +} + +// SetTurns gets a reference to the given []SyntheticsTestResultTurn and assigns it to the Turns field. +func (o *SyntheticsTestResultDetail) SetTurns(v []SyntheticsTestResultTurn) { + o.Turns = v +} + +// GetUnhealthy returns the Unhealthy field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetUnhealthy() bool { + if o == nil || o.Unhealthy == nil { + var ret bool + return ret + } + return *o.Unhealthy +} + +// GetUnhealthyOk returns a tuple with the Unhealthy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetUnhealthyOk() (*bool, bool) { + if o == nil || o.Unhealthy == nil { + return nil, false + } + return o.Unhealthy, true +} + +// HasUnhealthy returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasUnhealthy() bool { + return o != nil && o.Unhealthy != nil +} + +// SetUnhealthy gets a reference to the given bool and assigns it to the Unhealthy field. +func (o *SyntheticsTestResultDetail) SetUnhealthy(v bool) { + o.Unhealthy = &v +} + +// GetVariables returns the Variables field value if set, zero value otherwise. +func (o *SyntheticsTestResultDetail) GetVariables() SyntheticsTestResultVariables { + if o == nil || o.Variables == nil { + var ret SyntheticsTestResultVariables + return ret + } + return *o.Variables +} + +// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDetail) GetVariablesOk() (*SyntheticsTestResultVariables, bool) { + if o == nil || o.Variables == nil { + return nil, false + } + return o.Variables, true +} + +// HasVariables returns a boolean if a field has been set. +func (o *SyntheticsTestResultDetail) HasVariables() bool { + return o != nil && o.Variables != nil +} + +// SetVariables gets a reference to the given SyntheticsTestResultVariables and assigns it to the Variables field. +func (o *SyntheticsTestResultDetail) SetVariables(v SyntheticsTestResultVariables) { + o.Variables = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDetail) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Assertions != nil { + toSerialize["assertions"] = o.Assertions + } + if o.BucketKeys != nil { + toSerialize["bucket_keys"] = o.BucketKeys + } + if o.CallType != nil { + toSerialize["call_type"] = o.CallType + } + if o.Cert != nil { + toSerialize["cert"] = o.Cert + } + if o.CompressedJsonDescriptor != nil { + toSerialize["compressed_json_descriptor"] = o.CompressedJsonDescriptor + } + if o.CompressedSteps != nil { + toSerialize["compressed_steps"] = o.CompressedSteps + } + if o.ConnectionOutcome != nil { + toSerialize["connection_outcome"] = o.ConnectionOutcome + } + if o.DnsResolution != nil { + toSerialize["dns_resolution"] = o.DnsResolution + } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + if o.ExitedOnStepSuccess != nil { + toSerialize["exited_on_step_success"] = o.ExitedOnStepSuccess + } + if o.Failure != nil { + toSerialize["failure"] = o.Failure + } + if o.FinishedAt != nil { + toSerialize["finished_at"] = o.FinishedAt + } + if o.Handshake != nil { + toSerialize["handshake"] = o.Handshake + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.InitialId != nil { + toSerialize["initial_id"] = o.InitialId + } + if o.IsFastRetry != nil { + toSerialize["is_fast_retry"] = o.IsFastRetry + } + if o.IsLastRetry != nil { + toSerialize["is_last_retry"] = o.IsLastRetry + } + if o.Netpath != nil { + toSerialize["netpath"] = o.Netpath + } + if o.Netstats != nil { + toSerialize["netstats"] = o.Netstats + } + if o.Ocsp != nil { + toSerialize["ocsp"] = o.Ocsp + } + if o.Ping != nil { + toSerialize["ping"] = o.Ping + } + if o.ReceivedEmailCount != nil { + toSerialize["received_email_count"] = o.ReceivedEmailCount + } + if o.ReceivedMessage != nil { + toSerialize["received_message"] = o.ReceivedMessage + } + if o.Request != nil { + toSerialize["request"] = o.Request + } + if o.ResolvedIp != nil { + toSerialize["resolved_ip"] = o.ResolvedIp + } + if o.Response != nil { + toSerialize["response"] = o.Response + } + if o.RunType != nil { + toSerialize["run_type"] = o.RunType + } + if o.SentMessage != nil { + toSerialize["sent_message"] = o.SentMessage + } + if o.StartUrl != nil { + toSerialize["start_url"] = o.StartUrl + } + if o.StartedAt != nil { + toSerialize["started_at"] = o.StartedAt + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Steps != nil { + toSerialize["steps"] = o.Steps + } + if o.TimeToInteractive != nil { + toSerialize["time_to_interactive"] = o.TimeToInteractive + } + if o.Timings != nil { + toSerialize["timings"] = o.Timings + } + if o.Trace != nil { + toSerialize["trace"] = o.Trace + } + if o.Traceroute != nil { + toSerialize["traceroute"] = o.Traceroute + } + if o.TriggeredAt != nil { + toSerialize["triggered_at"] = o.TriggeredAt + } + if o.Tunnel != nil { + toSerialize["tunnel"] = o.Tunnel + } + if o.Turns != nil { + toSerialize["turns"] = o.Turns + } + if o.Unhealthy != nil { + toSerialize["unhealthy"] = o.Unhealthy + } + if o.Variables != nil { + toSerialize["variables"] = o.Variables + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDetail) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + CallType *string `json:"call_type,omitempty"` + Cert *SyntheticsTestResultCertificate `json:"cert,omitempty"` + CompressedJsonDescriptor *string `json:"compressed_json_descriptor,omitempty"` + CompressedSteps *string `json:"compressed_steps,omitempty"` + ConnectionOutcome *string `json:"connection_outcome,omitempty"` + DnsResolution *SyntheticsTestResultDnsResolution `json:"dns_resolution,omitempty"` + Duration *float64 `json:"duration,omitempty"` + ExitedOnStepSuccess *bool `json:"exited_on_step_success,omitempty"` + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` + FinishedAt *int64 `json:"finished_at,omitempty"` + Handshake *SyntheticsTestResultHandshake `json:"handshake,omitempty"` + Id *string `json:"id,omitempty"` + InitialId *string `json:"initial_id,omitempty"` + IsFastRetry *bool `json:"is_fast_retry,omitempty"` + IsLastRetry *bool `json:"is_last_retry,omitempty"` + Netpath *SyntheticsTestResultNetpath `json:"netpath,omitempty"` + Netstats *SyntheticsTestResultNetstats `json:"netstats,omitempty"` + Ocsp *SyntheticsTestResultOCSPResponse `json:"ocsp,omitempty"` + Ping *SyntheticsTestResultTracerouteHop `json:"ping,omitempty"` + ReceivedEmailCount *int64 `json:"received_email_count,omitempty"` + ReceivedMessage *string `json:"received_message,omitempty"` + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + ResolvedIp *string `json:"resolved_ip,omitempty"` + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` + SentMessage *string `json:"sent_message,omitempty"` + StartUrl *string `json:"start_url,omitempty"` + StartedAt *int64 `json:"started_at,omitempty"` + Status *SyntheticsTestResultStatus `json:"status,omitempty"` + Steps []SyntheticsTestResultStep `json:"steps,omitempty"` + TimeToInteractive *int64 `json:"time_to_interactive,omitempty"` + Timings map[string]interface{} `json:"timings,omitempty"` + Trace *SyntheticsTestResultTrace `json:"trace,omitempty"` + Traceroute []SyntheticsTestResultTracerouteHop `json:"traceroute,omitempty"` + TriggeredAt *int64 `json:"triggered_at,omitempty"` + Tunnel *bool `json:"tunnel,omitempty"` + Turns []SyntheticsTestResultTurn `json:"turns,omitempty"` + Unhealthy *bool `json:"unhealthy,omitempty"` + Variables *SyntheticsTestResultVariables `json:"variables,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"assertions", "bucket_keys", "call_type", "cert", "compressed_json_descriptor", "compressed_steps", "connection_outcome", "dns_resolution", "duration", "exited_on_step_success", "failure", "finished_at", "handshake", "id", "initial_id", "is_fast_retry", "is_last_retry", "netpath", "netstats", "ocsp", "ping", "received_email_count", "received_message", "request", "resolved_ip", "response", "run_type", "sent_message", "start_url", "started_at", "status", "steps", "time_to_interactive", "timings", "trace", "traceroute", "triggered_at", "tunnel", "turns", "unhealthy", "variables"}) + } else { + return err + } + + hasInvalidField := false + o.Assertions = all.Assertions + if all.BucketKeys != nil && all.BucketKeys.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BucketKeys = all.BucketKeys + o.CallType = all.CallType + if all.Cert != nil && all.Cert.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Cert = all.Cert + o.CompressedJsonDescriptor = all.CompressedJsonDescriptor + o.CompressedSteps = all.CompressedSteps + o.ConnectionOutcome = all.ConnectionOutcome + if all.DnsResolution != nil && all.DnsResolution.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.DnsResolution = all.DnsResolution + o.Duration = all.Duration + o.ExitedOnStepSuccess = all.ExitedOnStepSuccess + if all.Failure != nil && all.Failure.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Failure = all.Failure + o.FinishedAt = all.FinishedAt + if all.Handshake != nil && all.Handshake.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Handshake = all.Handshake + o.Id = all.Id + o.InitialId = all.InitialId + o.IsFastRetry = all.IsFastRetry + o.IsLastRetry = all.IsLastRetry + if all.Netpath != nil && all.Netpath.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Netpath = all.Netpath + if all.Netstats != nil && all.Netstats.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Netstats = all.Netstats + if all.Ocsp != nil && all.Ocsp.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Ocsp = all.Ocsp + if all.Ping != nil && all.Ping.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Ping = all.Ping + o.ReceivedEmailCount = all.ReceivedEmailCount + o.ReceivedMessage = all.ReceivedMessage + if all.Request != nil && all.Request.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Request = all.Request + o.ResolvedIp = all.ResolvedIp + if all.Response != nil && all.Response.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Response = all.Response + if all.RunType != nil && !all.RunType.IsValid() { + hasInvalidField = true + } else { + o.RunType = all.RunType + } + o.SentMessage = all.SentMessage + o.StartUrl = all.StartUrl + o.StartedAt = all.StartedAt + if all.Status != nil && !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = all.Status + } + o.Steps = all.Steps + o.TimeToInteractive = all.TimeToInteractive + o.Timings = all.Timings + if all.Trace != nil && all.Trace.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Trace = all.Trace + o.Traceroute = all.Traceroute + o.TriggeredAt = all.TriggeredAt + o.Tunnel = all.Tunnel + o.Turns = all.Turns + o.Unhealthy = all.Unhealthy + if all.Variables != nil && all.Variables.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Variables = all.Variables + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_device.go b/api/datadogV2/model_synthetics_test_result_device.go new file mode 100644 index 00000000000..9a79a5635b7 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_device.go @@ -0,0 +1,292 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDevice Device information for the test result (browser and mobile tests). +type SyntheticsTestResultDevice struct { + // Browser information for the device used to run the test. + Browser *SyntheticsTestResultDeviceBrowser `json:"browser,omitempty"` + // Device identifier. + Id *string `json:"id,omitempty"` + // Device name. + Name *string `json:"name,omitempty"` + // Platform information for the device used to run the test. + Platform *SyntheticsTestResultDevicePlatform `json:"platform,omitempty"` + // Screen resolution of the device used to run the test. + Resolution *SyntheticsTestResultDeviceResolution `json:"resolution,omitempty"` + // Device type. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDevice instantiates a new SyntheticsTestResultDevice object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDevice() *SyntheticsTestResultDevice { + this := SyntheticsTestResultDevice{} + return &this +} + +// NewSyntheticsTestResultDeviceWithDefaults instantiates a new SyntheticsTestResultDevice object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDeviceWithDefaults() *SyntheticsTestResultDevice { + this := SyntheticsTestResultDevice{} + return &this +} + +// GetBrowser returns the Browser field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetBrowser() SyntheticsTestResultDeviceBrowser { + if o == nil || o.Browser == nil { + var ret SyntheticsTestResultDeviceBrowser + return ret + } + return *o.Browser +} + +// GetBrowserOk returns a tuple with the Browser field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetBrowserOk() (*SyntheticsTestResultDeviceBrowser, bool) { + if o == nil || o.Browser == nil { + return nil, false + } + return o.Browser, true +} + +// HasBrowser returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasBrowser() bool { + return o != nil && o.Browser != nil +} + +// SetBrowser gets a reference to the given SyntheticsTestResultDeviceBrowser and assigns it to the Browser field. +func (o *SyntheticsTestResultDevice) SetBrowser(v SyntheticsTestResultDeviceBrowser) { + o.Browser = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultDevice) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultDevice) SetName(v string) { + o.Name = &v +} + +// GetPlatform returns the Platform field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetPlatform() SyntheticsTestResultDevicePlatform { + if o == nil || o.Platform == nil { + var ret SyntheticsTestResultDevicePlatform + return ret + } + return *o.Platform +} + +// GetPlatformOk returns a tuple with the Platform field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetPlatformOk() (*SyntheticsTestResultDevicePlatform, bool) { + if o == nil || o.Platform == nil { + return nil, false + } + return o.Platform, true +} + +// HasPlatform returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasPlatform() bool { + return o != nil && o.Platform != nil +} + +// SetPlatform gets a reference to the given SyntheticsTestResultDevicePlatform and assigns it to the Platform field. +func (o *SyntheticsTestResultDevice) SetPlatform(v SyntheticsTestResultDevicePlatform) { + o.Platform = &v +} + +// GetResolution returns the Resolution field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetResolution() SyntheticsTestResultDeviceResolution { + if o == nil || o.Resolution == nil { + var ret SyntheticsTestResultDeviceResolution + return ret + } + return *o.Resolution +} + +// GetResolutionOk returns a tuple with the Resolution field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetResolutionOk() (*SyntheticsTestResultDeviceResolution, bool) { + if o == nil || o.Resolution == nil { + return nil, false + } + return o.Resolution, true +} + +// HasResolution returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasResolution() bool { + return o != nil && o.Resolution != nil +} + +// SetResolution gets a reference to the given SyntheticsTestResultDeviceResolution and assigns it to the Resolution field. +func (o *SyntheticsTestResultDevice) SetResolution(v SyntheticsTestResultDeviceResolution) { + o.Resolution = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevice) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevice) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevice) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultDevice) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDevice) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Browser != nil { + toSerialize["browser"] = o.Browser + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Platform != nil { + toSerialize["platform"] = o.Platform + } + if o.Resolution != nil { + toSerialize["resolution"] = o.Resolution + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDevice) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Browser *SyntheticsTestResultDeviceBrowser `json:"browser,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Platform *SyntheticsTestResultDevicePlatform `json:"platform,omitempty"` + Resolution *SyntheticsTestResultDeviceResolution `json:"resolution,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"browser", "id", "name", "platform", "resolution", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Browser != nil && all.Browser.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Browser = all.Browser + o.Id = all.Id + o.Name = all.Name + if all.Platform != nil && all.Platform.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Platform = all.Platform + if all.Resolution != nil && all.Resolution.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Resolution = all.Resolution + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_device_browser.go b/api/datadogV2/model_synthetics_test_result_device_browser.go new file mode 100644 index 00000000000..13b4cd5bd06 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_device_browser.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDeviceBrowser Browser information for the device used to run the test. +type SyntheticsTestResultDeviceBrowser struct { + // Browser type (for example, `chrome`, `firefox`). + Type *string `json:"type,omitempty"` + // User agent string reported by the browser. + UserAgent *string `json:"user_agent,omitempty"` + // Browser version. + Version *string `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDeviceBrowser instantiates a new SyntheticsTestResultDeviceBrowser object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDeviceBrowser() *SyntheticsTestResultDeviceBrowser { + this := SyntheticsTestResultDeviceBrowser{} + return &this +} + +// NewSyntheticsTestResultDeviceBrowserWithDefaults instantiates a new SyntheticsTestResultDeviceBrowser object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDeviceBrowserWithDefaults() *SyntheticsTestResultDeviceBrowser { + this := SyntheticsTestResultDeviceBrowser{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceBrowser) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceBrowser) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceBrowser) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultDeviceBrowser) SetType(v string) { + o.Type = &v +} + +// GetUserAgent returns the UserAgent field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceBrowser) GetUserAgent() string { + if o == nil || o.UserAgent == nil { + var ret string + return ret + } + return *o.UserAgent +} + +// GetUserAgentOk returns a tuple with the UserAgent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceBrowser) GetUserAgentOk() (*string, bool) { + if o == nil || o.UserAgent == nil { + return nil, false + } + return o.UserAgent, true +} + +// HasUserAgent returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceBrowser) HasUserAgent() bool { + return o != nil && o.UserAgent != nil +} + +// SetUserAgent gets a reference to the given string and assigns it to the UserAgent field. +func (o *SyntheticsTestResultDeviceBrowser) SetUserAgent(v string) { + o.UserAgent = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceBrowser) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceBrowser) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceBrowser) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SyntheticsTestResultDeviceBrowser) SetVersion(v string) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDeviceBrowser) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.UserAgent != nil { + toSerialize["user_agent"] = o.UserAgent + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDeviceBrowser) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Type *string `json:"type,omitempty"` + UserAgent *string `json:"user_agent,omitempty"` + Version *string `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"type", "user_agent", "version"}) + } else { + return err + } + o.Type = all.Type + o.UserAgent = all.UserAgent + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_device_platform.go b/api/datadogV2/model_synthetics_test_result_device_platform.go new file mode 100644 index 00000000000..1bc3636b3d1 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_device_platform.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDevicePlatform Platform information for the device used to run the test. +type SyntheticsTestResultDevicePlatform struct { + // Platform name (for example, `linux`, `macos`). + Name *string `json:"name,omitempty"` + // Platform version. + Version *string `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDevicePlatform instantiates a new SyntheticsTestResultDevicePlatform object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDevicePlatform() *SyntheticsTestResultDevicePlatform { + this := SyntheticsTestResultDevicePlatform{} + return &this +} + +// NewSyntheticsTestResultDevicePlatformWithDefaults instantiates a new SyntheticsTestResultDevicePlatform object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDevicePlatformWithDefaults() *SyntheticsTestResultDevicePlatform { + this := SyntheticsTestResultDevicePlatform{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevicePlatform) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevicePlatform) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevicePlatform) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultDevicePlatform) SetName(v string) { + o.Name = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SyntheticsTestResultDevicePlatform) GetVersion() string { + if o == nil || o.Version == nil { + var ret string + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDevicePlatform) GetVersionOk() (*string, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SyntheticsTestResultDevicePlatform) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given string and assigns it to the Version field. +func (o *SyntheticsTestResultDevicePlatform) SetVersion(v string) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDevicePlatform) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDevicePlatform) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name", "version"}) + } else { + return err + } + o.Name = all.Name + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_device_resolution.go b/api/datadogV2/model_synthetics_test_result_device_resolution.go new file mode 100644 index 00000000000..1f75ddefa27 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_device_resolution.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDeviceResolution Screen resolution of the device used to run the test. +type SyntheticsTestResultDeviceResolution struct { + // Viewport height in pixels. + Height *int64 `json:"height,omitempty"` + // Device pixel ratio. + PixelRatio *float64 `json:"pixel_ratio,omitempty"` + // Viewport width in pixels. + Width *int64 `json:"width,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDeviceResolution instantiates a new SyntheticsTestResultDeviceResolution object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDeviceResolution() *SyntheticsTestResultDeviceResolution { + this := SyntheticsTestResultDeviceResolution{} + return &this +} + +// NewSyntheticsTestResultDeviceResolutionWithDefaults instantiates a new SyntheticsTestResultDeviceResolution object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDeviceResolutionWithDefaults() *SyntheticsTestResultDeviceResolution { + this := SyntheticsTestResultDeviceResolution{} + return &this +} + +// GetHeight returns the Height field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceResolution) GetHeight() int64 { + if o == nil || o.Height == nil { + var ret int64 + return ret + } + return *o.Height +} + +// GetHeightOk returns a tuple with the Height field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceResolution) GetHeightOk() (*int64, bool) { + if o == nil || o.Height == nil { + return nil, false + } + return o.Height, true +} + +// HasHeight returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceResolution) HasHeight() bool { + return o != nil && o.Height != nil +} + +// SetHeight gets a reference to the given int64 and assigns it to the Height field. +func (o *SyntheticsTestResultDeviceResolution) SetHeight(v int64) { + o.Height = &v +} + +// GetPixelRatio returns the PixelRatio field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceResolution) GetPixelRatio() float64 { + if o == nil || o.PixelRatio == nil { + var ret float64 + return ret + } + return *o.PixelRatio +} + +// GetPixelRatioOk returns a tuple with the PixelRatio field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceResolution) GetPixelRatioOk() (*float64, bool) { + if o == nil || o.PixelRatio == nil { + return nil, false + } + return o.PixelRatio, true +} + +// HasPixelRatio returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceResolution) HasPixelRatio() bool { + return o != nil && o.PixelRatio != nil +} + +// SetPixelRatio gets a reference to the given float64 and assigns it to the PixelRatio field. +func (o *SyntheticsTestResultDeviceResolution) SetPixelRatio(v float64) { + o.PixelRatio = &v +} + +// GetWidth returns the Width field value if set, zero value otherwise. +func (o *SyntheticsTestResultDeviceResolution) GetWidth() int64 { + if o == nil || o.Width == nil { + var ret int64 + return ret + } + return *o.Width +} + +// GetWidthOk returns a tuple with the Width field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDeviceResolution) GetWidthOk() (*int64, bool) { + if o == nil || o.Width == nil { + return nil, false + } + return o.Width, true +} + +// HasWidth returns a boolean if a field has been set. +func (o *SyntheticsTestResultDeviceResolution) HasWidth() bool { + return o != nil && o.Width != nil +} + +// SetWidth gets a reference to the given int64 and assigns it to the Width field. +func (o *SyntheticsTestResultDeviceResolution) SetWidth(v int64) { + o.Width = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDeviceResolution) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Height != nil { + toSerialize["height"] = o.Height + } + if o.PixelRatio != nil { + toSerialize["pixel_ratio"] = o.PixelRatio + } + if o.Width != nil { + toSerialize["width"] = o.Width + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDeviceResolution) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Height *int64 `json:"height,omitempty"` + PixelRatio *float64 `json:"pixel_ratio,omitempty"` + Width *int64 `json:"width,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"height", "pixel_ratio", "width"}) + } else { + return err + } + o.Height = all.Height + o.PixelRatio = all.PixelRatio + o.Width = all.Width + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_dns_record.go b/api/datadogV2/model_synthetics_test_result_dns_record.go new file mode 100644 index 00000000000..0a7eaab81c8 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_dns_record.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDnsRecord A DNS record returned in a DNS test response. +type SyntheticsTestResultDnsRecord struct { + // DNS record type (for example, `A`, `AAAA`, `CNAME`). + Type *string `json:"type,omitempty"` + // Values associated with the DNS record. + Values []string `json:"values,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDnsRecord instantiates a new SyntheticsTestResultDnsRecord object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDnsRecord() *SyntheticsTestResultDnsRecord { + this := SyntheticsTestResultDnsRecord{} + return &this +} + +// NewSyntheticsTestResultDnsRecordWithDefaults instantiates a new SyntheticsTestResultDnsRecord object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDnsRecordWithDefaults() *SyntheticsTestResultDnsRecord { + this := SyntheticsTestResultDnsRecord{} + return &this +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsRecord) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsRecord) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsRecord) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultDnsRecord) SetType(v string) { + o.Type = &v +} + +// GetValues returns the Values field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsRecord) GetValues() []string { + if o == nil || o.Values == nil { + var ret []string + return ret + } + return o.Values +} + +// GetValuesOk returns a tuple with the Values field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsRecord) GetValuesOk() (*[]string, bool) { + if o == nil || o.Values == nil { + return nil, false + } + return &o.Values, true +} + +// HasValues returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsRecord) HasValues() bool { + return o != nil && o.Values != nil +} + +// SetValues gets a reference to the given []string and assigns it to the Values field. +func (o *SyntheticsTestResultDnsRecord) SetValues(v []string) { + o.Values = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDnsRecord) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Values != nil { + toSerialize["values"] = o.Values + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDnsRecord) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Type *string `json:"type,omitempty"` + Values []string `json:"values,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"type", "values"}) + } else { + return err + } + o.Type = all.Type + o.Values = all.Values + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_dns_resolution.go b/api/datadogV2/model_synthetics_test_result_dns_resolution.go new file mode 100644 index 00000000000..95c4925ed4a --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_dns_resolution.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDnsResolution DNS resolution details recorded during the test execution. +type SyntheticsTestResultDnsResolution struct { + // DNS resolution attempts made during the test. + Attempts []map[string]string `json:"attempts,omitempty"` + // Resolved IP address for the target host. + ResolvedIp *string `json:"resolved_ip,omitempty"` + // Resolved port for the target service. + ResolvedPort *string `json:"resolved_port,omitempty"` + // DNS server used for the resolution. + Server *string `json:"server,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDnsResolution instantiates a new SyntheticsTestResultDnsResolution object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDnsResolution() *SyntheticsTestResultDnsResolution { + this := SyntheticsTestResultDnsResolution{} + return &this +} + +// NewSyntheticsTestResultDnsResolutionWithDefaults instantiates a new SyntheticsTestResultDnsResolution object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDnsResolutionWithDefaults() *SyntheticsTestResultDnsResolution { + this := SyntheticsTestResultDnsResolution{} + return &this +} + +// GetAttempts returns the Attempts field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsResolution) GetAttempts() []map[string]string { + if o == nil || o.Attempts == nil { + var ret []map[string]string + return ret + } + return o.Attempts +} + +// GetAttemptsOk returns a tuple with the Attempts field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsResolution) GetAttemptsOk() (*[]map[string]string, bool) { + if o == nil || o.Attempts == nil { + return nil, false + } + return &o.Attempts, true +} + +// HasAttempts returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsResolution) HasAttempts() bool { + return o != nil && o.Attempts != nil +} + +// SetAttempts gets a reference to the given []map[string]string and assigns it to the Attempts field. +func (o *SyntheticsTestResultDnsResolution) SetAttempts(v []map[string]string) { + o.Attempts = v +} + +// GetResolvedIp returns the ResolvedIp field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsResolution) GetResolvedIp() string { + if o == nil || o.ResolvedIp == nil { + var ret string + return ret + } + return *o.ResolvedIp +} + +// GetResolvedIpOk returns a tuple with the ResolvedIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsResolution) GetResolvedIpOk() (*string, bool) { + if o == nil || o.ResolvedIp == nil { + return nil, false + } + return o.ResolvedIp, true +} + +// HasResolvedIp returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsResolution) HasResolvedIp() bool { + return o != nil && o.ResolvedIp != nil +} + +// SetResolvedIp gets a reference to the given string and assigns it to the ResolvedIp field. +func (o *SyntheticsTestResultDnsResolution) SetResolvedIp(v string) { + o.ResolvedIp = &v +} + +// GetResolvedPort returns the ResolvedPort field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsResolution) GetResolvedPort() string { + if o == nil || o.ResolvedPort == nil { + var ret string + return ret + } + return *o.ResolvedPort +} + +// GetResolvedPortOk returns a tuple with the ResolvedPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsResolution) GetResolvedPortOk() (*string, bool) { + if o == nil || o.ResolvedPort == nil { + return nil, false + } + return o.ResolvedPort, true +} + +// HasResolvedPort returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsResolution) HasResolvedPort() bool { + return o != nil && o.ResolvedPort != nil +} + +// SetResolvedPort gets a reference to the given string and assigns it to the ResolvedPort field. +func (o *SyntheticsTestResultDnsResolution) SetResolvedPort(v string) { + o.ResolvedPort = &v +} + +// GetServer returns the Server field value if set, zero value otherwise. +func (o *SyntheticsTestResultDnsResolution) GetServer() string { + if o == nil || o.Server == nil { + var ret string + return ret + } + return *o.Server +} + +// GetServerOk returns a tuple with the Server field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDnsResolution) GetServerOk() (*string, bool) { + if o == nil || o.Server == nil { + return nil, false + } + return o.Server, true +} + +// HasServer returns a boolean if a field has been set. +func (o *SyntheticsTestResultDnsResolution) HasServer() bool { + return o != nil && o.Server != nil +} + +// SetServer gets a reference to the given string and assigns it to the Server field. +func (o *SyntheticsTestResultDnsResolution) SetServer(v string) { + o.Server = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDnsResolution) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attempts != nil { + toSerialize["attempts"] = o.Attempts + } + if o.ResolvedIp != nil { + toSerialize["resolved_ip"] = o.ResolvedIp + } + if o.ResolvedPort != nil { + toSerialize["resolved_port"] = o.ResolvedPort + } + if o.Server != nil { + toSerialize["server"] = o.Server + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDnsResolution) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attempts []map[string]string `json:"attempts,omitempty"` + ResolvedIp *string `json:"resolved_ip,omitempty"` + ResolvedPort *string `json:"resolved_port,omitempty"` + Server *string `json:"server,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attempts", "resolved_ip", "resolved_port", "server"}) + } else { + return err + } + o.Attempts = all.Attempts + o.ResolvedIp = all.ResolvedIp + o.ResolvedPort = all.ResolvedPort + o.Server = all.Server + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_duration.go b/api/datadogV2/model_synthetics_test_result_duration.go new file mode 100644 index 00000000000..36f1e664baf --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_duration.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultDuration Total duration of a Synthetic test execution. +type SyntheticsTestResultDuration struct { + // Whether a duration was recorded for this execution. + HasDuration *bool `json:"has_duration,omitempty"` + // Duration value in milliseconds. + Value *int64 `json:"value,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultDuration instantiates a new SyntheticsTestResultDuration object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultDuration() *SyntheticsTestResultDuration { + this := SyntheticsTestResultDuration{} + return &this +} + +// NewSyntheticsTestResultDurationWithDefaults instantiates a new SyntheticsTestResultDuration object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultDurationWithDefaults() *SyntheticsTestResultDuration { + this := SyntheticsTestResultDuration{} + return &this +} + +// GetHasDuration returns the HasDuration field value if set, zero value otherwise. +func (o *SyntheticsTestResultDuration) GetHasDuration() bool { + if o == nil || o.HasDuration == nil { + var ret bool + return ret + } + return *o.HasDuration +} + +// GetHasDurationOk returns a tuple with the HasDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDuration) GetHasDurationOk() (*bool, bool) { + if o == nil || o.HasDuration == nil { + return nil, false + } + return o.HasDuration, true +} + +// HasHasDuration returns a boolean if a field has been set. +func (o *SyntheticsTestResultDuration) HasHasDuration() bool { + return o != nil && o.HasDuration != nil +} + +// SetHasDuration gets a reference to the given bool and assigns it to the HasDuration field. +func (o *SyntheticsTestResultDuration) SetHasDuration(v bool) { + o.HasDuration = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *SyntheticsTestResultDuration) GetValue() int64 { + if o == nil || o.Value == nil { + var ret int64 + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultDuration) GetValueOk() (*int64, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *SyntheticsTestResultDuration) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given int64 and assigns it to the Value field. +func (o *SyntheticsTestResultDuration) SetValue(v int64) { + o.Value = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultDuration) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.HasDuration != nil { + toSerialize["has_duration"] = o.HasDuration + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultDuration) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + HasDuration *bool `json:"has_duration,omitempty"` + Value *int64 `json:"value,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"has_duration", "value"}) + } else { + return err + } + o.HasDuration = all.HasDuration + o.Value = all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_execution_info.go b/api/datadogV2/model_synthetics_test_result_execution_info.go new file mode 100644 index 00000000000..d1e88cd3147 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_execution_info.go @@ -0,0 +1,286 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultExecutionInfo Execution details for a Synthetic test result. +type SyntheticsTestResultExecutionInfo struct { + // Total duration of a Synthetic test execution. + Duration *SyntheticsTestResultDuration `json:"duration,omitempty"` + // Error message if the execution encountered an issue. + ErrorMessage *string `json:"error_message,omitempty"` + // Whether this result is from a fast retry. + IsFastRetry *bool `json:"is_fast_retry,omitempty"` + // Timing breakdown of the test execution in milliseconds. + Timings map[string]interface{} `json:"timings,omitempty"` + // Whether the test was executed through a tunnel. + Tunnel *bool `json:"tunnel,omitempty"` + // Whether the location was unhealthy during execution. + Unhealthy *bool `json:"unhealthy,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultExecutionInfo instantiates a new SyntheticsTestResultExecutionInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultExecutionInfo() *SyntheticsTestResultExecutionInfo { + this := SyntheticsTestResultExecutionInfo{} + return &this +} + +// NewSyntheticsTestResultExecutionInfoWithDefaults instantiates a new SyntheticsTestResultExecutionInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultExecutionInfoWithDefaults() *SyntheticsTestResultExecutionInfo { + this := SyntheticsTestResultExecutionInfo{} + return &this +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetDuration() SyntheticsTestResultDuration { + if o == nil || o.Duration == nil { + var ret SyntheticsTestResultDuration + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetDurationOk() (*SyntheticsTestResultDuration, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given SyntheticsTestResultDuration and assigns it to the Duration field. +func (o *SyntheticsTestResultExecutionInfo) SetDuration(v SyntheticsTestResultDuration) { + o.Duration = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasErrorMessage() bool { + return o != nil && o.ErrorMessage != nil +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *SyntheticsTestResultExecutionInfo) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetIsFastRetry returns the IsFastRetry field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetIsFastRetry() bool { + if o == nil || o.IsFastRetry == nil { + var ret bool + return ret + } + return *o.IsFastRetry +} + +// GetIsFastRetryOk returns a tuple with the IsFastRetry field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetIsFastRetryOk() (*bool, bool) { + if o == nil || o.IsFastRetry == nil { + return nil, false + } + return o.IsFastRetry, true +} + +// HasIsFastRetry returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasIsFastRetry() bool { + return o != nil && o.IsFastRetry != nil +} + +// SetIsFastRetry gets a reference to the given bool and assigns it to the IsFastRetry field. +func (o *SyntheticsTestResultExecutionInfo) SetIsFastRetry(v bool) { + o.IsFastRetry = &v +} + +// GetTimings returns the Timings field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetTimings() map[string]interface{} { + if o == nil || o.Timings == nil { + var ret map[string]interface{} + return ret + } + return o.Timings +} + +// GetTimingsOk returns a tuple with the Timings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetTimingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Timings == nil { + return nil, false + } + return &o.Timings, true +} + +// HasTimings returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasTimings() bool { + return o != nil && o.Timings != nil +} + +// SetTimings gets a reference to the given map[string]interface{} and assigns it to the Timings field. +func (o *SyntheticsTestResultExecutionInfo) SetTimings(v map[string]interface{}) { + o.Timings = v +} + +// GetTunnel returns the Tunnel field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetTunnel() bool { + if o == nil || o.Tunnel == nil { + var ret bool + return ret + } + return *o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetTunnelOk() (*bool, bool) { + if o == nil || o.Tunnel == nil { + return nil, false + } + return o.Tunnel, true +} + +// HasTunnel returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasTunnel() bool { + return o != nil && o.Tunnel != nil +} + +// SetTunnel gets a reference to the given bool and assigns it to the Tunnel field. +func (o *SyntheticsTestResultExecutionInfo) SetTunnel(v bool) { + o.Tunnel = &v +} + +// GetUnhealthy returns the Unhealthy field value if set, zero value otherwise. +func (o *SyntheticsTestResultExecutionInfo) GetUnhealthy() bool { + if o == nil || o.Unhealthy == nil { + var ret bool + return ret + } + return *o.Unhealthy +} + +// GetUnhealthyOk returns a tuple with the Unhealthy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultExecutionInfo) GetUnhealthyOk() (*bool, bool) { + if o == nil || o.Unhealthy == nil { + return nil, false + } + return o.Unhealthy, true +} + +// HasUnhealthy returns a boolean if a field has been set. +func (o *SyntheticsTestResultExecutionInfo) HasUnhealthy() bool { + return o != nil && o.Unhealthy != nil +} + +// SetUnhealthy gets a reference to the given bool and assigns it to the Unhealthy field. +func (o *SyntheticsTestResultExecutionInfo) SetUnhealthy(v bool) { + o.Unhealthy = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultExecutionInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.IsFastRetry != nil { + toSerialize["is_fast_retry"] = o.IsFastRetry + } + if o.Timings != nil { + toSerialize["timings"] = o.Timings + } + if o.Tunnel != nil { + toSerialize["tunnel"] = o.Tunnel + } + if o.Unhealthy != nil { + toSerialize["unhealthy"] = o.Unhealthy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultExecutionInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Duration *SyntheticsTestResultDuration `json:"duration,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + IsFastRetry *bool `json:"is_fast_retry,omitempty"` + Timings map[string]interface{} `json:"timings,omitempty"` + Tunnel *bool `json:"tunnel,omitempty"` + Unhealthy *bool `json:"unhealthy,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"duration", "error_message", "is_fast_retry", "timings", "tunnel", "unhealthy"}) + } else { + return err + } + + hasInvalidField := false + if all.Duration != nil && all.Duration.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Duration = all.Duration + o.ErrorMessage = all.ErrorMessage + o.IsFastRetry = all.IsFastRetry + o.Timings = all.Timings + o.Tunnel = all.Tunnel + o.Unhealthy = all.Unhealthy + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_failure.go b/api/datadogV2/model_synthetics_test_result_failure.go new file mode 100644 index 00000000000..26de6eb034a --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_failure.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultFailure Details about the failure of a Synthetic test. +type SyntheticsTestResultFailure struct { + // Error code for the failure. + Code *string `json:"code,omitempty"` + // Internal error code used for debugging. + InternalCode *string `json:"internal_code,omitempty"` + // Internal error message used for debugging. + InternalMessage *string `json:"internal_message,omitempty"` + // Error message for the failure. + Message *string `json:"message,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultFailure instantiates a new SyntheticsTestResultFailure object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultFailure() *SyntheticsTestResultFailure { + this := SyntheticsTestResultFailure{} + return &this +} + +// NewSyntheticsTestResultFailureWithDefaults instantiates a new SyntheticsTestResultFailure object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultFailureWithDefaults() *SyntheticsTestResultFailure { + this := SyntheticsTestResultFailure{} + return &this +} + +// GetCode returns the Code field value if set, zero value otherwise. +func (o *SyntheticsTestResultFailure) GetCode() string { + if o == nil || o.Code == nil { + var ret string + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFailure) GetCodeOk() (*string, bool) { + if o == nil || o.Code == nil { + return nil, false + } + return o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultFailure) HasCode() bool { + return o != nil && o.Code != nil +} + +// SetCode gets a reference to the given string and assigns it to the Code field. +func (o *SyntheticsTestResultFailure) SetCode(v string) { + o.Code = &v +} + +// GetInternalCode returns the InternalCode field value if set, zero value otherwise. +func (o *SyntheticsTestResultFailure) GetInternalCode() string { + if o == nil || o.InternalCode == nil { + var ret string + return ret + } + return *o.InternalCode +} + +// GetInternalCodeOk returns a tuple with the InternalCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFailure) GetInternalCodeOk() (*string, bool) { + if o == nil || o.InternalCode == nil { + return nil, false + } + return o.InternalCode, true +} + +// HasInternalCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultFailure) HasInternalCode() bool { + return o != nil && o.InternalCode != nil +} + +// SetInternalCode gets a reference to the given string and assigns it to the InternalCode field. +func (o *SyntheticsTestResultFailure) SetInternalCode(v string) { + o.InternalCode = &v +} + +// GetInternalMessage returns the InternalMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultFailure) GetInternalMessage() string { + if o == nil || o.InternalMessage == nil { + var ret string + return ret + } + return *o.InternalMessage +} + +// GetInternalMessageOk returns a tuple with the InternalMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFailure) GetInternalMessageOk() (*string, bool) { + if o == nil || o.InternalMessage == nil { + return nil, false + } + return o.InternalMessage, true +} + +// HasInternalMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultFailure) HasInternalMessage() bool { + return o != nil && o.InternalMessage != nil +} + +// SetInternalMessage gets a reference to the given string and assigns it to the InternalMessage field. +func (o *SyntheticsTestResultFailure) SetInternalMessage(v string) { + o.InternalMessage = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultFailure) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFailure) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultFailure) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SyntheticsTestResultFailure) SetMessage(v string) { + o.Message = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultFailure) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.InternalCode != nil { + toSerialize["internal_code"] = o.InternalCode + } + if o.InternalMessage != nil { + toSerialize["internal_message"] = o.InternalMessage + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultFailure) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Code *string `json:"code,omitempty"` + InternalCode *string `json:"internal_code,omitempty"` + InternalMessage *string `json:"internal_message,omitempty"` + Message *string `json:"message,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"code", "internal_code", "internal_message", "message"}) + } else { + return err + } + o.Code = all.Code + o.InternalCode = all.InternalCode + o.InternalMessage = all.InternalMessage + o.Message = all.Message + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_file_ref.go b/api/datadogV2/model_synthetics_test_result_file_ref.go new file mode 100644 index 00000000000..3c802a1e177 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_file_ref.go @@ -0,0 +1,242 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultFileRef Reference to a file attached to a Synthetic test request. +type SyntheticsTestResultFileRef struct { + // Storage bucket key where the file is stored. + BucketKey *string `json:"bucket_key,omitempty"` + // Encoding of the file contents. + Encoding *string `json:"encoding,omitempty"` + // File name. + Name *string `json:"name,omitempty"` + // File size in bytes. + Size *int64 `json:"size,omitempty"` + // File MIME type. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultFileRef instantiates a new SyntheticsTestResultFileRef object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultFileRef() *SyntheticsTestResultFileRef { + this := SyntheticsTestResultFileRef{} + return &this +} + +// NewSyntheticsTestResultFileRefWithDefaults instantiates a new SyntheticsTestResultFileRef object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultFileRefWithDefaults() *SyntheticsTestResultFileRef { + this := SyntheticsTestResultFileRef{} + return &this +} + +// GetBucketKey returns the BucketKey field value if set, zero value otherwise. +func (o *SyntheticsTestResultFileRef) GetBucketKey() string { + if o == nil || o.BucketKey == nil { + var ret string + return ret + } + return *o.BucketKey +} + +// GetBucketKeyOk returns a tuple with the BucketKey field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFileRef) GetBucketKeyOk() (*string, bool) { + if o == nil || o.BucketKey == nil { + return nil, false + } + return o.BucketKey, true +} + +// HasBucketKey returns a boolean if a field has been set. +func (o *SyntheticsTestResultFileRef) HasBucketKey() bool { + return o != nil && o.BucketKey != nil +} + +// SetBucketKey gets a reference to the given string and assigns it to the BucketKey field. +func (o *SyntheticsTestResultFileRef) SetBucketKey(v string) { + o.BucketKey = &v +} + +// GetEncoding returns the Encoding field value if set, zero value otherwise. +func (o *SyntheticsTestResultFileRef) GetEncoding() string { + if o == nil || o.Encoding == nil { + var ret string + return ret + } + return *o.Encoding +} + +// GetEncodingOk returns a tuple with the Encoding field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFileRef) GetEncodingOk() (*string, bool) { + if o == nil || o.Encoding == nil { + return nil, false + } + return o.Encoding, true +} + +// HasEncoding returns a boolean if a field has been set. +func (o *SyntheticsTestResultFileRef) HasEncoding() bool { + return o != nil && o.Encoding != nil +} + +// SetEncoding gets a reference to the given string and assigns it to the Encoding field. +func (o *SyntheticsTestResultFileRef) SetEncoding(v string) { + o.Encoding = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultFileRef) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFileRef) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultFileRef) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultFileRef) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *SyntheticsTestResultFileRef) GetSize() int64 { + if o == nil || o.Size == nil { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFileRef) GetSizeOk() (*int64, bool) { + if o == nil || o.Size == nil { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *SyntheticsTestResultFileRef) HasSize() bool { + return o != nil && o.Size != nil +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *SyntheticsTestResultFileRef) SetSize(v int64) { + o.Size = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultFileRef) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultFileRef) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultFileRef) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultFileRef) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultFileRef) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.BucketKey != nil { + toSerialize["bucket_key"] = o.BucketKey + } + if o.Encoding != nil { + toSerialize["encoding"] = o.Encoding + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Size != nil { + toSerialize["size"] = o.Size + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultFileRef) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BucketKey *string `json:"bucket_key,omitempty"` + Encoding *string `json:"encoding,omitempty"` + Name *string `json:"name,omitempty"` + Size *int64 `json:"size,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"bucket_key", "encoding", "name", "size", "type"}) + } else { + return err + } + o.BucketKey = all.BucketKey + o.Encoding = all.Encoding + o.Name = all.Name + o.Size = all.Size + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_git.go b/api/datadogV2/model_synthetics_test_result_git.go new file mode 100644 index 00000000000..eb5bcf53d0e --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_git.go @@ -0,0 +1,181 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultGit Git information associated with the test result. +type SyntheticsTestResultGit struct { + // Git branch name. + Branch *string `json:"branch,omitempty"` + // Details of the Git commit associated with the test result. + Commit *SyntheticsTestResultGitCommit `json:"commit,omitempty"` + // Git repository URL. + RepositoryUrl *string `json:"repository_url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultGit instantiates a new SyntheticsTestResultGit object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultGit() *SyntheticsTestResultGit { + this := SyntheticsTestResultGit{} + return &this +} + +// NewSyntheticsTestResultGitWithDefaults instantiates a new SyntheticsTestResultGit object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultGitWithDefaults() *SyntheticsTestResultGit { + this := SyntheticsTestResultGit{} + return &this +} + +// GetBranch returns the Branch field value if set, zero value otherwise. +func (o *SyntheticsTestResultGit) GetBranch() string { + if o == nil || o.Branch == nil { + var ret string + return ret + } + return *o.Branch +} + +// GetBranchOk returns a tuple with the Branch field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGit) GetBranchOk() (*string, bool) { + if o == nil || o.Branch == nil { + return nil, false + } + return o.Branch, true +} + +// HasBranch returns a boolean if a field has been set. +func (o *SyntheticsTestResultGit) HasBranch() bool { + return o != nil && o.Branch != nil +} + +// SetBranch gets a reference to the given string and assigns it to the Branch field. +func (o *SyntheticsTestResultGit) SetBranch(v string) { + o.Branch = &v +} + +// GetCommit returns the Commit field value if set, zero value otherwise. +func (o *SyntheticsTestResultGit) GetCommit() SyntheticsTestResultGitCommit { + if o == nil || o.Commit == nil { + var ret SyntheticsTestResultGitCommit + return ret + } + return *o.Commit +} + +// GetCommitOk returns a tuple with the Commit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGit) GetCommitOk() (*SyntheticsTestResultGitCommit, bool) { + if o == nil || o.Commit == nil { + return nil, false + } + return o.Commit, true +} + +// HasCommit returns a boolean if a field has been set. +func (o *SyntheticsTestResultGit) HasCommit() bool { + return o != nil && o.Commit != nil +} + +// SetCommit gets a reference to the given SyntheticsTestResultGitCommit and assigns it to the Commit field. +func (o *SyntheticsTestResultGit) SetCommit(v SyntheticsTestResultGitCommit) { + o.Commit = &v +} + +// GetRepositoryUrl returns the RepositoryUrl field value if set, zero value otherwise. +func (o *SyntheticsTestResultGit) GetRepositoryUrl() string { + if o == nil || o.RepositoryUrl == nil { + var ret string + return ret + } + return *o.RepositoryUrl +} + +// GetRepositoryUrlOk returns a tuple with the RepositoryUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGit) GetRepositoryUrlOk() (*string, bool) { + if o == nil || o.RepositoryUrl == nil { + return nil, false + } + return o.RepositoryUrl, true +} + +// HasRepositoryUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultGit) HasRepositoryUrl() bool { + return o != nil && o.RepositoryUrl != nil +} + +// SetRepositoryUrl gets a reference to the given string and assigns it to the RepositoryUrl field. +func (o *SyntheticsTestResultGit) SetRepositoryUrl(v string) { + o.RepositoryUrl = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultGit) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Branch != nil { + toSerialize["branch"] = o.Branch + } + if o.Commit != nil { + toSerialize["commit"] = o.Commit + } + if o.RepositoryUrl != nil { + toSerialize["repository_url"] = o.RepositoryUrl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultGit) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Branch *string `json:"branch,omitempty"` + Commit *SyntheticsTestResultGitCommit `json:"commit,omitempty"` + RepositoryUrl *string `json:"repository_url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"branch", "commit", "repository_url"}) + } else { + return err + } + + hasInvalidField := false + o.Branch = all.Branch + if all.Commit != nil && all.Commit.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Commit = all.Commit + o.RepositoryUrl = all.RepositoryUrl + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_git_commit.go b/api/datadogV2/model_synthetics_test_result_git_commit.go new file mode 100644 index 00000000000..b7a6dd276fb --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_git_commit.go @@ -0,0 +1,254 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultGitCommit Details of the Git commit associated with the test result. +type SyntheticsTestResultGitCommit struct { + // A Git user (author or committer). + Author *SyntheticsTestResultGitUser `json:"author,omitempty"` + // A Git user (author or committer). + Committer *SyntheticsTestResultGitUser `json:"committer,omitempty"` + // Commit message. + Message *string `json:"message,omitempty"` + // Commit SHA. + Sha *string `json:"sha,omitempty"` + // URL of the commit. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultGitCommit instantiates a new SyntheticsTestResultGitCommit object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultGitCommit() *SyntheticsTestResultGitCommit { + this := SyntheticsTestResultGitCommit{} + return &this +} + +// NewSyntheticsTestResultGitCommitWithDefaults instantiates a new SyntheticsTestResultGitCommit object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultGitCommitWithDefaults() *SyntheticsTestResultGitCommit { + this := SyntheticsTestResultGitCommit{} + return &this +} + +// GetAuthor returns the Author field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitCommit) GetAuthor() SyntheticsTestResultGitUser { + if o == nil || o.Author == nil { + var ret SyntheticsTestResultGitUser + return ret + } + return *o.Author +} + +// GetAuthorOk returns a tuple with the Author field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitCommit) GetAuthorOk() (*SyntheticsTestResultGitUser, bool) { + if o == nil || o.Author == nil { + return nil, false + } + return o.Author, true +} + +// HasAuthor returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitCommit) HasAuthor() bool { + return o != nil && o.Author != nil +} + +// SetAuthor gets a reference to the given SyntheticsTestResultGitUser and assigns it to the Author field. +func (o *SyntheticsTestResultGitCommit) SetAuthor(v SyntheticsTestResultGitUser) { + o.Author = &v +} + +// GetCommitter returns the Committer field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitCommit) GetCommitter() SyntheticsTestResultGitUser { + if o == nil || o.Committer == nil { + var ret SyntheticsTestResultGitUser + return ret + } + return *o.Committer +} + +// GetCommitterOk returns a tuple with the Committer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitCommit) GetCommitterOk() (*SyntheticsTestResultGitUser, bool) { + if o == nil || o.Committer == nil { + return nil, false + } + return o.Committer, true +} + +// HasCommitter returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitCommit) HasCommitter() bool { + return o != nil && o.Committer != nil +} + +// SetCommitter gets a reference to the given SyntheticsTestResultGitUser and assigns it to the Committer field. +func (o *SyntheticsTestResultGitCommit) SetCommitter(v SyntheticsTestResultGitUser) { + o.Committer = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitCommit) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitCommit) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitCommit) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SyntheticsTestResultGitCommit) SetMessage(v string) { + o.Message = &v +} + +// GetSha returns the Sha field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitCommit) GetSha() string { + if o == nil || o.Sha == nil { + var ret string + return ret + } + return *o.Sha +} + +// GetShaOk returns a tuple with the Sha field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitCommit) GetShaOk() (*string, bool) { + if o == nil || o.Sha == nil { + return nil, false + } + return o.Sha, true +} + +// HasSha returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitCommit) HasSha() bool { + return o != nil && o.Sha != nil +} + +// SetSha gets a reference to the given string and assigns it to the Sha field. +func (o *SyntheticsTestResultGitCommit) SetSha(v string) { + o.Sha = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitCommit) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitCommit) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitCommit) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultGitCommit) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultGitCommit) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Author != nil { + toSerialize["author"] = o.Author + } + if o.Committer != nil { + toSerialize["committer"] = o.Committer + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Sha != nil { + toSerialize["sha"] = o.Sha + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultGitCommit) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Author *SyntheticsTestResultGitUser `json:"author,omitempty"` + Committer *SyntheticsTestResultGitUser `json:"committer,omitempty"` + Message *string `json:"message,omitempty"` + Sha *string `json:"sha,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"author", "committer", "message", "sha", "url"}) + } else { + return err + } + + hasInvalidField := false + if all.Author != nil && all.Author.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Author = all.Author + if all.Committer != nil && all.Committer.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Committer = all.Committer + o.Message = all.Message + o.Sha = all.Sha + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_git_user.go b/api/datadogV2/model_synthetics_test_result_git_user.go new file mode 100644 index 00000000000..7d389b0d0fc --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_git_user.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultGitUser A Git user (author or committer). +type SyntheticsTestResultGitUser struct { + // Timestamp of the commit action for this user. + Date *string `json:"date,omitempty"` + // Email address of the Git user. + Email *string `json:"email,omitempty"` + // Name of the Git user. + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultGitUser instantiates a new SyntheticsTestResultGitUser object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultGitUser() *SyntheticsTestResultGitUser { + this := SyntheticsTestResultGitUser{} + return &this +} + +// NewSyntheticsTestResultGitUserWithDefaults instantiates a new SyntheticsTestResultGitUser object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultGitUserWithDefaults() *SyntheticsTestResultGitUser { + this := SyntheticsTestResultGitUser{} + return &this +} + +// GetDate returns the Date field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitUser) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitUser) GetDateOk() (*string, bool) { + if o == nil || o.Date == nil { + return nil, false + } + return o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitUser) HasDate() bool { + return o != nil && o.Date != nil +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *SyntheticsTestResultGitUser) SetDate(v string) { + o.Date = &v +} + +// GetEmail returns the Email field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitUser) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitUser) GetEmailOk() (*string, bool) { + if o == nil || o.Email == nil { + return nil, false + } + return o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitUser) HasEmail() bool { + return o != nil && o.Email != nil +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *SyntheticsTestResultGitUser) SetEmail(v string) { + o.Email = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultGitUser) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultGitUser) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultGitUser) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultGitUser) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultGitUser) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultGitUser) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Date *string `json:"date,omitempty"` + Email *string `json:"email,omitempty"` + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"date", "email", "name"}) + } else { + return err + } + o.Date = all.Date + o.Email = all.Email + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_handshake.go b/api/datadogV2/model_synthetics_test_result_handshake.go new file mode 100644 index 00000000000..dcbfaa78030 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_handshake.go @@ -0,0 +1,149 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultHandshake Handshake request and response for protocol-level tests. +type SyntheticsTestResultHandshake struct { + // Details of the outgoing request made during the test execution. + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + // Details of the response received during the test execution. + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultHandshake instantiates a new SyntheticsTestResultHandshake object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultHandshake() *SyntheticsTestResultHandshake { + this := SyntheticsTestResultHandshake{} + return &this +} + +// NewSyntheticsTestResultHandshakeWithDefaults instantiates a new SyntheticsTestResultHandshake object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultHandshakeWithDefaults() *SyntheticsTestResultHandshake { + this := SyntheticsTestResultHandshake{} + return &this +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *SyntheticsTestResultHandshake) GetRequest() SyntheticsTestResultRequestInfo { + if o == nil || o.Request == nil { + var ret SyntheticsTestResultRequestInfo + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultHandshake) GetRequestOk() (*SyntheticsTestResultRequestInfo, bool) { + if o == nil || o.Request == nil { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *SyntheticsTestResultHandshake) HasRequest() bool { + return o != nil && o.Request != nil +} + +// SetRequest gets a reference to the given SyntheticsTestResultRequestInfo and assigns it to the Request field. +func (o *SyntheticsTestResultHandshake) SetRequest(v SyntheticsTestResultRequestInfo) { + o.Request = &v +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *SyntheticsTestResultHandshake) GetResponse() SyntheticsTestResultResponseInfo { + if o == nil || o.Response == nil { + var ret SyntheticsTestResultResponseInfo + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultHandshake) GetResponseOk() (*SyntheticsTestResultResponseInfo, bool) { + if o == nil || o.Response == nil { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *SyntheticsTestResultHandshake) HasResponse() bool { + return o != nil && o.Response != nil +} + +// SetResponse gets a reference to the given SyntheticsTestResultResponseInfo and assigns it to the Response field. +func (o *SyntheticsTestResultHandshake) SetResponse(v SyntheticsTestResultResponseInfo) { + o.Response = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultHandshake) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Request != nil { + toSerialize["request"] = o.Request + } + if o.Response != nil { + toSerialize["response"] = o.Response + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultHandshake) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"request", "response"}) + } else { + return err + } + + hasInvalidField := false + if all.Request != nil && all.Request.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Request = all.Request + if all.Response != nil && all.Response.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Response = all.Response + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_health_check.go b/api/datadogV2/model_synthetics_test_result_health_check.go new file mode 100644 index 00000000000..8c2ef986c79 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_health_check.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultHealthCheck Health check information returned from a gRPC health check call. +type SyntheticsTestResultHealthCheck struct { + // Raw health check message payload. + Message map[string]string `json:"message,omitempty"` + // Health check status code. + Status *int64 `json:"status,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultHealthCheck instantiates a new SyntheticsTestResultHealthCheck object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultHealthCheck() *SyntheticsTestResultHealthCheck { + this := SyntheticsTestResultHealthCheck{} + return &this +} + +// NewSyntheticsTestResultHealthCheckWithDefaults instantiates a new SyntheticsTestResultHealthCheck object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultHealthCheckWithDefaults() *SyntheticsTestResultHealthCheck { + this := SyntheticsTestResultHealthCheck{} + return &this +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultHealthCheck) GetMessage() map[string]string { + if o == nil || o.Message == nil { + var ret map[string]string + return ret + } + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultHealthCheck) GetMessageOk() (*map[string]string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return &o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultHealthCheck) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given map[string]string and assigns it to the Message field. +func (o *SyntheticsTestResultHealthCheck) SetMessage(v map[string]string) { + o.Message = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultHealthCheck) GetStatus() int64 { + if o == nil || o.Status == nil { + var ret int64 + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultHealthCheck) GetStatusOk() (*int64, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultHealthCheck) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given int64 and assigns it to the Status field. +func (o *SyntheticsTestResultHealthCheck) SetStatus(v int64) { + o.Status = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultHealthCheck) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultHealthCheck) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Message map[string]string `json:"message,omitempty"` + Status *int64 `json:"status,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"message", "status"}) + } else { + return err + } + o.Message = all.Message + o.Status = all.Status + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_included_item.go b/api/datadogV2/model_synthetics_test_result_included_item.go new file mode 100644 index 00000000000..104ec0dfde5 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_included_item.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultIncludedItem An included related resource. +type SyntheticsTestResultIncludedItem struct { + // Attributes of the included resource. + Attributes map[string]interface{} `json:"attributes,omitempty"` + // ID of the included resource. + Id *string `json:"id,omitempty"` + // Type of the included resource. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultIncludedItem instantiates a new SyntheticsTestResultIncludedItem object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultIncludedItem() *SyntheticsTestResultIncludedItem { + this := SyntheticsTestResultIncludedItem{} + return &this +} + +// NewSyntheticsTestResultIncludedItemWithDefaults instantiates a new SyntheticsTestResultIncludedItem object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultIncludedItemWithDefaults() *SyntheticsTestResultIncludedItem { + this := SyntheticsTestResultIncludedItem{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SyntheticsTestResultIncludedItem) GetAttributes() map[string]interface{} { + if o == nil || o.Attributes == nil { + var ret map[string]interface{} + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultIncludedItem) GetAttributesOk() (*map[string]interface{}, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return &o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SyntheticsTestResultIncludedItem) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field. +func (o *SyntheticsTestResultIncludedItem) SetAttributes(v map[string]interface{}) { + o.Attributes = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultIncludedItem) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultIncludedItem) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultIncludedItem) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultIncludedItem) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultIncludedItem) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultIncludedItem) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultIncludedItem) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultIncludedItem) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultIncludedItem) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultIncludedItem) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes map[string]interface{} `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + o.Attributes = all.Attributes + o.Id = all.Id + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_fast_test_result_location.go b/api/datadogV2/model_synthetics_test_result_location.go similarity index 71% rename from api/datadogV2/model_synthetics_fast_test_result_location.go rename to api/datadogV2/model_synthetics_test_result_location.go index 514a8c8dd9d..cf22a103e0b 100644 --- a/api/datadogV2/model_synthetics_fast_test_result_location.go +++ b/api/datadogV2/model_synthetics_test_result_location.go @@ -8,13 +8,13 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SyntheticsFastTestResultLocation Location from which the fast test was executed. -type SyntheticsFastTestResultLocation struct { - // ID of the location. +// SyntheticsTestResultLocation Location information for a Synthetic test result. +type SyntheticsTestResultLocation struct { + // Identifier of the location. Id *string `json:"id,omitempty"` - // Display name of the location. + // Human-readable name of the location. Name *string `json:"name,omitempty"` - // Agent version running at this location. + // Version of the worker that ran the test. Version *string `json:"version,omitempty"` // Identifier of the specific worker that ran the test. WorkerId *string `json:"worker_id,omitempty"` @@ -23,25 +23,25 @@ type SyntheticsFastTestResultLocation struct { AdditionalProperties map[string]interface{} `json:"-"` } -// NewSyntheticsFastTestResultLocation instantiates a new SyntheticsFastTestResultLocation object. +// NewSyntheticsTestResultLocation instantiates a new SyntheticsTestResultLocation object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewSyntheticsFastTestResultLocation() *SyntheticsFastTestResultLocation { - this := SyntheticsFastTestResultLocation{} +func NewSyntheticsTestResultLocation() *SyntheticsTestResultLocation { + this := SyntheticsTestResultLocation{} return &this } -// NewSyntheticsFastTestResultLocationWithDefaults instantiates a new SyntheticsFastTestResultLocation object. +// NewSyntheticsTestResultLocationWithDefaults instantiates a new SyntheticsTestResultLocation object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewSyntheticsFastTestResultLocationWithDefaults() *SyntheticsFastTestResultLocation { - this := SyntheticsFastTestResultLocation{} +func NewSyntheticsTestResultLocationWithDefaults() *SyntheticsTestResultLocation { + this := SyntheticsTestResultLocation{} return &this } // GetId returns the Id field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultLocation) GetId() string { +func (o *SyntheticsTestResultLocation) GetId() string { if o == nil || o.Id == nil { var ret string return ret @@ -51,7 +51,7 @@ func (o *SyntheticsFastTestResultLocation) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultLocation) GetIdOk() (*string, bool) { +func (o *SyntheticsTestResultLocation) GetIdOk() (*string, bool) { if o == nil || o.Id == nil { return nil, false } @@ -59,17 +59,17 @@ func (o *SyntheticsFastTestResultLocation) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultLocation) HasId() bool { +func (o *SyntheticsTestResultLocation) HasId() bool { return o != nil && o.Id != nil } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *SyntheticsFastTestResultLocation) SetId(v string) { +func (o *SyntheticsTestResultLocation) SetId(v string) { o.Id = &v } // GetName returns the Name field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultLocation) GetName() string { +func (o *SyntheticsTestResultLocation) GetName() string { if o == nil || o.Name == nil { var ret string return ret @@ -79,7 +79,7 @@ func (o *SyntheticsFastTestResultLocation) GetName() string { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultLocation) GetNameOk() (*string, bool) { +func (o *SyntheticsTestResultLocation) GetNameOk() (*string, bool) { if o == nil || o.Name == nil { return nil, false } @@ -87,17 +87,17 @@ func (o *SyntheticsFastTestResultLocation) GetNameOk() (*string, bool) { } // HasName returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultLocation) HasName() bool { +func (o *SyntheticsTestResultLocation) HasName() bool { return o != nil && o.Name != nil } // SetName gets a reference to the given string and assigns it to the Name field. -func (o *SyntheticsFastTestResultLocation) SetName(v string) { +func (o *SyntheticsTestResultLocation) SetName(v string) { o.Name = &v } // GetVersion returns the Version field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultLocation) GetVersion() string { +func (o *SyntheticsTestResultLocation) GetVersion() string { if o == nil || o.Version == nil { var ret string return ret @@ -107,7 +107,7 @@ func (o *SyntheticsFastTestResultLocation) GetVersion() string { // GetVersionOk returns a tuple with the Version field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultLocation) GetVersionOk() (*string, bool) { +func (o *SyntheticsTestResultLocation) GetVersionOk() (*string, bool) { if o == nil || o.Version == nil { return nil, false } @@ -115,17 +115,17 @@ func (o *SyntheticsFastTestResultLocation) GetVersionOk() (*string, bool) { } // HasVersion returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultLocation) HasVersion() bool { +func (o *SyntheticsTestResultLocation) HasVersion() bool { return o != nil && o.Version != nil } // SetVersion gets a reference to the given string and assigns it to the Version field. -func (o *SyntheticsFastTestResultLocation) SetVersion(v string) { +func (o *SyntheticsTestResultLocation) SetVersion(v string) { o.Version = &v } // GetWorkerId returns the WorkerId field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultLocation) GetWorkerId() string { +func (o *SyntheticsTestResultLocation) GetWorkerId() string { if o == nil || o.WorkerId == nil { var ret string return ret @@ -135,7 +135,7 @@ func (o *SyntheticsFastTestResultLocation) GetWorkerId() string { // GetWorkerIdOk returns a tuple with the WorkerId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultLocation) GetWorkerIdOk() (*string, bool) { +func (o *SyntheticsTestResultLocation) GetWorkerIdOk() (*string, bool) { if o == nil || o.WorkerId == nil { return nil, false } @@ -143,17 +143,17 @@ func (o *SyntheticsFastTestResultLocation) GetWorkerIdOk() (*string, bool) { } // HasWorkerId returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultLocation) HasWorkerId() bool { +func (o *SyntheticsTestResultLocation) HasWorkerId() bool { return o != nil && o.WorkerId != nil } // SetWorkerId gets a reference to the given string and assigns it to the WorkerId field. -func (o *SyntheticsFastTestResultLocation) SetWorkerId(v string) { +func (o *SyntheticsTestResultLocation) SetWorkerId(v string) { o.WorkerId = &v } // MarshalJSON serializes the struct using spec logic. -func (o SyntheticsFastTestResultLocation) MarshalJSON() ([]byte, error) { +func (o SyntheticsTestResultLocation) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -178,7 +178,7 @@ func (o SyntheticsFastTestResultLocation) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *SyntheticsFastTestResultLocation) UnmarshalJSON(bytes []byte) (err error) { +func (o *SyntheticsTestResultLocation) UnmarshalJSON(bytes []byte) (err error) { all := struct { Id *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` diff --git a/api/datadogV2/model_synthetics_test_result_netpath.go b/api/datadogV2/model_synthetics_test_result_netpath.go new file mode 100644 index 00000000000..d72b02bf21b --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netpath.go @@ -0,0 +1,359 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetpath Network Path test result capturing the path between source and destination. +type SyntheticsTestResultNetpath struct { + // Destination endpoint of a network path measurement. + Destination *SyntheticsTestResultNetpathDestination `json:"destination,omitempty"` + // Hops along the network path. + Hops []SyntheticsTestResultNetpathHop `json:"hops,omitempty"` + // Origin of the network path (for example, probe source). + Origin *string `json:"origin,omitempty"` + // Identifier of the path trace. + PathtraceId *string `json:"pathtrace_id,omitempty"` + // Protocol used for the path trace (for example, `tcp`, `udp`, `icmp`). + Protocol *string `json:"protocol,omitempty"` + // Source endpoint of a network path measurement. + Source *SyntheticsTestResultNetpathEndpoint `json:"source,omitempty"` + // Tags associated with the network path measurement. + Tags []string `json:"tags,omitempty"` + // Unix timestamp (ms) of the network path measurement. + Timestamp *int64 `json:"timestamp,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetpath instantiates a new SyntheticsTestResultNetpath object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetpath() *SyntheticsTestResultNetpath { + this := SyntheticsTestResultNetpath{} + return &this +} + +// NewSyntheticsTestResultNetpathWithDefaults instantiates a new SyntheticsTestResultNetpath object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetpathWithDefaults() *SyntheticsTestResultNetpath { + this := SyntheticsTestResultNetpath{} + return &this +} + +// GetDestination returns the Destination field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetDestination() SyntheticsTestResultNetpathDestination { + if o == nil || o.Destination == nil { + var ret SyntheticsTestResultNetpathDestination + return ret + } + return *o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetDestinationOk() (*SyntheticsTestResultNetpathDestination, bool) { + if o == nil || o.Destination == nil { + return nil, false + } + return o.Destination, true +} + +// HasDestination returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasDestination() bool { + return o != nil && o.Destination != nil +} + +// SetDestination gets a reference to the given SyntheticsTestResultNetpathDestination and assigns it to the Destination field. +func (o *SyntheticsTestResultNetpath) SetDestination(v SyntheticsTestResultNetpathDestination) { + o.Destination = &v +} + +// GetHops returns the Hops field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetHops() []SyntheticsTestResultNetpathHop { + if o == nil || o.Hops == nil { + var ret []SyntheticsTestResultNetpathHop + return ret + } + return o.Hops +} + +// GetHopsOk returns a tuple with the Hops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetHopsOk() (*[]SyntheticsTestResultNetpathHop, bool) { + if o == nil || o.Hops == nil { + return nil, false + } + return &o.Hops, true +} + +// HasHops returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasHops() bool { + return o != nil && o.Hops != nil +} + +// SetHops gets a reference to the given []SyntheticsTestResultNetpathHop and assigns it to the Hops field. +func (o *SyntheticsTestResultNetpath) SetHops(v []SyntheticsTestResultNetpathHop) { + o.Hops = v +} + +// GetOrigin returns the Origin field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetOrigin() string { + if o == nil || o.Origin == nil { + var ret string + return ret + } + return *o.Origin +} + +// GetOriginOk returns a tuple with the Origin field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetOriginOk() (*string, bool) { + if o == nil || o.Origin == nil { + return nil, false + } + return o.Origin, true +} + +// HasOrigin returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasOrigin() bool { + return o != nil && o.Origin != nil +} + +// SetOrigin gets a reference to the given string and assigns it to the Origin field. +func (o *SyntheticsTestResultNetpath) SetOrigin(v string) { + o.Origin = &v +} + +// GetPathtraceId returns the PathtraceId field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetPathtraceId() string { + if o == nil || o.PathtraceId == nil { + var ret string + return ret + } + return *o.PathtraceId +} + +// GetPathtraceIdOk returns a tuple with the PathtraceId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetPathtraceIdOk() (*string, bool) { + if o == nil || o.PathtraceId == nil { + return nil, false + } + return o.PathtraceId, true +} + +// HasPathtraceId returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasPathtraceId() bool { + return o != nil && o.PathtraceId != nil +} + +// SetPathtraceId gets a reference to the given string and assigns it to the PathtraceId field. +func (o *SyntheticsTestResultNetpath) SetPathtraceId(v string) { + o.PathtraceId = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetProtocol() string { + if o == nil || o.Protocol == nil { + var ret string + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetProtocolOk() (*string, bool) { + if o == nil || o.Protocol == nil { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasProtocol() bool { + return o != nil && o.Protocol != nil +} + +// SetProtocol gets a reference to the given string and assigns it to the Protocol field. +func (o *SyntheticsTestResultNetpath) SetProtocol(v string) { + o.Protocol = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetSource() SyntheticsTestResultNetpathEndpoint { + if o == nil || o.Source == nil { + var ret SyntheticsTestResultNetpathEndpoint + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetSourceOk() (*SyntheticsTestResultNetpathEndpoint, bool) { + if o == nil || o.Source == nil { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasSource() bool { + return o != nil && o.Source != nil +} + +// SetSource gets a reference to the given SyntheticsTestResultNetpathEndpoint and assigns it to the Source field. +func (o *SyntheticsTestResultNetpath) SetSource(v SyntheticsTestResultNetpathEndpoint) { + o.Source = &v +} + +// GetTags returns the Tags field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetTags() []string { + if o == nil || o.Tags == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetTagsOk() (*[]string, bool) { + if o == nil || o.Tags == nil { + return nil, false + } + return &o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasTags() bool { + return o != nil && o.Tags != nil +} + +// SetTags gets a reference to the given []string and assigns it to the Tags field. +func (o *SyntheticsTestResultNetpath) SetTags(v []string) { + o.Tags = v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpath) GetTimestamp() int64 { + if o == nil || o.Timestamp == nil { + var ret int64 + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpath) GetTimestampOk() (*int64, bool) { + if o == nil || o.Timestamp == nil { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpath) HasTimestamp() bool { + return o != nil && o.Timestamp != nil +} + +// SetTimestamp gets a reference to the given int64 and assigns it to the Timestamp field. +func (o *SyntheticsTestResultNetpath) SetTimestamp(v int64) { + o.Timestamp = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetpath) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Destination != nil { + toSerialize["destination"] = o.Destination + } + if o.Hops != nil { + toSerialize["hops"] = o.Hops + } + if o.Origin != nil { + toSerialize["origin"] = o.Origin + } + if o.PathtraceId != nil { + toSerialize["pathtrace_id"] = o.PathtraceId + } + if o.Protocol != nil { + toSerialize["protocol"] = o.Protocol + } + if o.Source != nil { + toSerialize["source"] = o.Source + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Timestamp != nil { + toSerialize["timestamp"] = o.Timestamp + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetpath) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Destination *SyntheticsTestResultNetpathDestination `json:"destination,omitempty"` + Hops []SyntheticsTestResultNetpathHop `json:"hops,omitempty"` + Origin *string `json:"origin,omitempty"` + PathtraceId *string `json:"pathtrace_id,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Source *SyntheticsTestResultNetpathEndpoint `json:"source,omitempty"` + Tags []string `json:"tags,omitempty"` + Timestamp *int64 `json:"timestamp,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"destination", "hops", "origin", "pathtrace_id", "protocol", "source", "tags", "timestamp"}) + } else { + return err + } + + hasInvalidField := false + if all.Destination != nil && all.Destination.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Destination = all.Destination + o.Hops = all.Hops + o.Origin = all.Origin + o.PathtraceId = all.PathtraceId + o.Protocol = all.Protocol + if all.Source != nil && all.Source.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Source = all.Source + o.Tags = all.Tags + o.Timestamp = all.Timestamp + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_netpath_destination.go b/api/datadogV2/model_synthetics_test_result_netpath_destination.go new file mode 100644 index 00000000000..fd2015f921e --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netpath_destination.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetpathDestination Destination endpoint of a network path measurement. +type SyntheticsTestResultNetpathDestination struct { + // Hostname of the destination. + Hostname *string `json:"hostname,omitempty"` + // IP address of the destination. + IpAddress *string `json:"ip_address,omitempty"` + // Port of the destination service. + Port *int64 `json:"port,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetpathDestination instantiates a new SyntheticsTestResultNetpathDestination object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetpathDestination() *SyntheticsTestResultNetpathDestination { + this := SyntheticsTestResultNetpathDestination{} + return &this +} + +// NewSyntheticsTestResultNetpathDestinationWithDefaults instantiates a new SyntheticsTestResultNetpathDestination object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetpathDestinationWithDefaults() *SyntheticsTestResultNetpathDestination { + this := SyntheticsTestResultNetpathDestination{} + return &this +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathDestination) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathDestination) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathDestination) HasHostname() bool { + return o != nil && o.Hostname != nil +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *SyntheticsTestResultNetpathDestination) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddress returns the IpAddress field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathDestination) GetIpAddress() string { + if o == nil || o.IpAddress == nil { + var ret string + return ret + } + return *o.IpAddress +} + +// GetIpAddressOk returns a tuple with the IpAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathDestination) GetIpAddressOk() (*string, bool) { + if o == nil || o.IpAddress == nil { + return nil, false + } + return o.IpAddress, true +} + +// HasIpAddress returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathDestination) HasIpAddress() bool { + return o != nil && o.IpAddress != nil +} + +// SetIpAddress gets a reference to the given string and assigns it to the IpAddress field. +func (o *SyntheticsTestResultNetpathDestination) SetIpAddress(v string) { + o.IpAddress = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathDestination) GetPort() int64 { + if o == nil || o.Port == nil { + var ret int64 + return ret + } + return *o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathDestination) GetPortOk() (*int64, bool) { + if o == nil || o.Port == nil { + return nil, false + } + return o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathDestination) HasPort() bool { + return o != nil && o.Port != nil +} + +// SetPort gets a reference to the given int64 and assigns it to the Port field. +func (o *SyntheticsTestResultNetpathDestination) SetPort(v int64) { + o.Port = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetpathDestination) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.IpAddress != nil { + toSerialize["ip_address"] = o.IpAddress + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetpathDestination) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Hostname *string `json:"hostname,omitempty"` + IpAddress *string `json:"ip_address,omitempty"` + Port *int64 `json:"port,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"hostname", "ip_address", "port"}) + } else { + return err + } + o.Hostname = all.Hostname + o.IpAddress = all.IpAddress + o.Port = all.Port + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_netpath_endpoint.go b/api/datadogV2/model_synthetics_test_result_netpath_endpoint.go new file mode 100644 index 00000000000..0a8e2fbc753 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netpath_endpoint.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetpathEndpoint Source endpoint of a network path measurement. +type SyntheticsTestResultNetpathEndpoint struct { + // Hostname of the endpoint. + Hostname *string `json:"hostname,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetpathEndpoint instantiates a new SyntheticsTestResultNetpathEndpoint object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetpathEndpoint() *SyntheticsTestResultNetpathEndpoint { + this := SyntheticsTestResultNetpathEndpoint{} + return &this +} + +// NewSyntheticsTestResultNetpathEndpointWithDefaults instantiates a new SyntheticsTestResultNetpathEndpoint object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetpathEndpointWithDefaults() *SyntheticsTestResultNetpathEndpoint { + this := SyntheticsTestResultNetpathEndpoint{} + return &this +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathEndpoint) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathEndpoint) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathEndpoint) HasHostname() bool { + return o != nil && o.Hostname != nil +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *SyntheticsTestResultNetpathEndpoint) SetHostname(v string) { + o.Hostname = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetpathEndpoint) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetpathEndpoint) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Hostname *string `json:"hostname,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"hostname"}) + } else { + return err + } + o.Hostname = all.Hostname + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_netpath_hop.go b/api/datadogV2/model_synthetics_test_result_netpath_hop.go new file mode 100644 index 00000000000..2a367ae8c37 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netpath_hop.go @@ -0,0 +1,242 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetpathHop A single hop along a network path. +type SyntheticsTestResultNetpathHop struct { + // Resolved hostname of the hop. + Hostname *string `json:"hostname,omitempty"` + // IP address of the hop. + IpAddress *string `json:"ip_address,omitempty"` + // Whether this hop was reachable. + Reachable *bool `json:"reachable,omitempty"` + // Round-trip time to this hop in milliseconds. + Rtt *float64 `json:"rtt,omitempty"` + // Time-to-live value of the probe packet at this hop. + Ttl *int64 `json:"ttl,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetpathHop instantiates a new SyntheticsTestResultNetpathHop object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetpathHop() *SyntheticsTestResultNetpathHop { + this := SyntheticsTestResultNetpathHop{} + return &this +} + +// NewSyntheticsTestResultNetpathHopWithDefaults instantiates a new SyntheticsTestResultNetpathHop object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetpathHopWithDefaults() *SyntheticsTestResultNetpathHop { + this := SyntheticsTestResultNetpathHop{} + return &this +} + +// GetHostname returns the Hostname field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathHop) GetHostname() string { + if o == nil || o.Hostname == nil { + var ret string + return ret + } + return *o.Hostname +} + +// GetHostnameOk returns a tuple with the Hostname field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathHop) GetHostnameOk() (*string, bool) { + if o == nil || o.Hostname == nil { + return nil, false + } + return o.Hostname, true +} + +// HasHostname returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathHop) HasHostname() bool { + return o != nil && o.Hostname != nil +} + +// SetHostname gets a reference to the given string and assigns it to the Hostname field. +func (o *SyntheticsTestResultNetpathHop) SetHostname(v string) { + o.Hostname = &v +} + +// GetIpAddress returns the IpAddress field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathHop) GetIpAddress() string { + if o == nil || o.IpAddress == nil { + var ret string + return ret + } + return *o.IpAddress +} + +// GetIpAddressOk returns a tuple with the IpAddress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathHop) GetIpAddressOk() (*string, bool) { + if o == nil || o.IpAddress == nil { + return nil, false + } + return o.IpAddress, true +} + +// HasIpAddress returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathHop) HasIpAddress() bool { + return o != nil && o.IpAddress != nil +} + +// SetIpAddress gets a reference to the given string and assigns it to the IpAddress field. +func (o *SyntheticsTestResultNetpathHop) SetIpAddress(v string) { + o.IpAddress = &v +} + +// GetReachable returns the Reachable field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathHop) GetReachable() bool { + if o == nil || o.Reachable == nil { + var ret bool + return ret + } + return *o.Reachable +} + +// GetReachableOk returns a tuple with the Reachable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathHop) GetReachableOk() (*bool, bool) { + if o == nil || o.Reachable == nil { + return nil, false + } + return o.Reachable, true +} + +// HasReachable returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathHop) HasReachable() bool { + return o != nil && o.Reachable != nil +} + +// SetReachable gets a reference to the given bool and assigns it to the Reachable field. +func (o *SyntheticsTestResultNetpathHop) SetReachable(v bool) { + o.Reachable = &v +} + +// GetRtt returns the Rtt field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathHop) GetRtt() float64 { + if o == nil || o.Rtt == nil { + var ret float64 + return ret + } + return *o.Rtt +} + +// GetRttOk returns a tuple with the Rtt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathHop) GetRttOk() (*float64, bool) { + if o == nil || o.Rtt == nil { + return nil, false + } + return o.Rtt, true +} + +// HasRtt returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathHop) HasRtt() bool { + return o != nil && o.Rtt != nil +} + +// SetRtt gets a reference to the given float64 and assigns it to the Rtt field. +func (o *SyntheticsTestResultNetpathHop) SetRtt(v float64) { + o.Rtt = &v +} + +// GetTtl returns the Ttl field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetpathHop) GetTtl() int64 { + if o == nil || o.Ttl == nil { + var ret int64 + return ret + } + return *o.Ttl +} + +// GetTtlOk returns a tuple with the Ttl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetpathHop) GetTtlOk() (*int64, bool) { + if o == nil || o.Ttl == nil { + return nil, false + } + return o.Ttl, true +} + +// HasTtl returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetpathHop) HasTtl() bool { + return o != nil && o.Ttl != nil +} + +// SetTtl gets a reference to the given int64 and assigns it to the Ttl field. +func (o *SyntheticsTestResultNetpathHop) SetTtl(v int64) { + o.Ttl = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetpathHop) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Hostname != nil { + toSerialize["hostname"] = o.Hostname + } + if o.IpAddress != nil { + toSerialize["ip_address"] = o.IpAddress + } + if o.Reachable != nil { + toSerialize["reachable"] = o.Reachable + } + if o.Rtt != nil { + toSerialize["rtt"] = o.Rtt + } + if o.Ttl != nil { + toSerialize["ttl"] = o.Ttl + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetpathHop) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Hostname *string `json:"hostname,omitempty"` + IpAddress *string `json:"ip_address,omitempty"` + Reachable *bool `json:"reachable,omitempty"` + Rtt *float64 `json:"rtt,omitempty"` + Ttl *int64 `json:"ttl,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"hostname", "ip_address", "reachable", "rtt", "ttl"}) + } else { + return err + } + o.Hostname = all.Hostname + o.IpAddress = all.IpAddress + o.Reachable = all.Reachable + o.Rtt = all.Rtt + o.Ttl = all.Ttl + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_netstats.go b/api/datadogV2/model_synthetics_test_result_netstats.go new file mode 100644 index 00000000000..9263ecdcde6 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netstats.go @@ -0,0 +1,289 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetstats Aggregated network statistics from the test execution. +type SyntheticsTestResultNetstats struct { + // Statistics about the number of hops for a network test. + Hops *SyntheticsTestResultNetstatsHops `json:"hops,omitempty"` + // Network jitter in milliseconds. + Jitter *float64 `json:"jitter,omitempty"` + // Latency statistics for a network probe. + Latency *SyntheticsTestResultNetworkLatency `json:"latency,omitempty"` + // Percentage of probe packets lost. + PacketLossPercentage *float64 `json:"packet_loss_percentage,omitempty"` + // Number of probe packets received. + PacketsReceived *int64 `json:"packets_received,omitempty"` + // Number of probe packets sent. + PacketsSent *int64 `json:"packets_sent,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetstats instantiates a new SyntheticsTestResultNetstats object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetstats() *SyntheticsTestResultNetstats { + this := SyntheticsTestResultNetstats{} + return &this +} + +// NewSyntheticsTestResultNetstatsWithDefaults instantiates a new SyntheticsTestResultNetstats object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetstatsWithDefaults() *SyntheticsTestResultNetstats { + this := SyntheticsTestResultNetstats{} + return &this +} + +// GetHops returns the Hops field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetHops() SyntheticsTestResultNetstatsHops { + if o == nil || o.Hops == nil { + var ret SyntheticsTestResultNetstatsHops + return ret + } + return *o.Hops +} + +// GetHopsOk returns a tuple with the Hops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetHopsOk() (*SyntheticsTestResultNetstatsHops, bool) { + if o == nil || o.Hops == nil { + return nil, false + } + return o.Hops, true +} + +// HasHops returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasHops() bool { + return o != nil && o.Hops != nil +} + +// SetHops gets a reference to the given SyntheticsTestResultNetstatsHops and assigns it to the Hops field. +func (o *SyntheticsTestResultNetstats) SetHops(v SyntheticsTestResultNetstatsHops) { + o.Hops = &v +} + +// GetJitter returns the Jitter field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetJitter() float64 { + if o == nil || o.Jitter == nil { + var ret float64 + return ret + } + return *o.Jitter +} + +// GetJitterOk returns a tuple with the Jitter field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetJitterOk() (*float64, bool) { + if o == nil || o.Jitter == nil { + return nil, false + } + return o.Jitter, true +} + +// HasJitter returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasJitter() bool { + return o != nil && o.Jitter != nil +} + +// SetJitter gets a reference to the given float64 and assigns it to the Jitter field. +func (o *SyntheticsTestResultNetstats) SetJitter(v float64) { + o.Jitter = &v +} + +// GetLatency returns the Latency field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetLatency() SyntheticsTestResultNetworkLatency { + if o == nil || o.Latency == nil { + var ret SyntheticsTestResultNetworkLatency + return ret + } + return *o.Latency +} + +// GetLatencyOk returns a tuple with the Latency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetLatencyOk() (*SyntheticsTestResultNetworkLatency, bool) { + if o == nil || o.Latency == nil { + return nil, false + } + return o.Latency, true +} + +// HasLatency returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasLatency() bool { + return o != nil && o.Latency != nil +} + +// SetLatency gets a reference to the given SyntheticsTestResultNetworkLatency and assigns it to the Latency field. +func (o *SyntheticsTestResultNetstats) SetLatency(v SyntheticsTestResultNetworkLatency) { + o.Latency = &v +} + +// GetPacketLossPercentage returns the PacketLossPercentage field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetPacketLossPercentage() float64 { + if o == nil || o.PacketLossPercentage == nil { + var ret float64 + return ret + } + return *o.PacketLossPercentage +} + +// GetPacketLossPercentageOk returns a tuple with the PacketLossPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetPacketLossPercentageOk() (*float64, bool) { + if o == nil || o.PacketLossPercentage == nil { + return nil, false + } + return o.PacketLossPercentage, true +} + +// HasPacketLossPercentage returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasPacketLossPercentage() bool { + return o != nil && o.PacketLossPercentage != nil +} + +// SetPacketLossPercentage gets a reference to the given float64 and assigns it to the PacketLossPercentage field. +func (o *SyntheticsTestResultNetstats) SetPacketLossPercentage(v float64) { + o.PacketLossPercentage = &v +} + +// GetPacketsReceived returns the PacketsReceived field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetPacketsReceived() int64 { + if o == nil || o.PacketsReceived == nil { + var ret int64 + return ret + } + return *o.PacketsReceived +} + +// GetPacketsReceivedOk returns a tuple with the PacketsReceived field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetPacketsReceivedOk() (*int64, bool) { + if o == nil || o.PacketsReceived == nil { + return nil, false + } + return o.PacketsReceived, true +} + +// HasPacketsReceived returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasPacketsReceived() bool { + return o != nil && o.PacketsReceived != nil +} + +// SetPacketsReceived gets a reference to the given int64 and assigns it to the PacketsReceived field. +func (o *SyntheticsTestResultNetstats) SetPacketsReceived(v int64) { + o.PacketsReceived = &v +} + +// GetPacketsSent returns the PacketsSent field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstats) GetPacketsSent() int64 { + if o == nil || o.PacketsSent == nil { + var ret int64 + return ret + } + return *o.PacketsSent +} + +// GetPacketsSentOk returns a tuple with the PacketsSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstats) GetPacketsSentOk() (*int64, bool) { + if o == nil || o.PacketsSent == nil { + return nil, false + } + return o.PacketsSent, true +} + +// HasPacketsSent returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstats) HasPacketsSent() bool { + return o != nil && o.PacketsSent != nil +} + +// SetPacketsSent gets a reference to the given int64 and assigns it to the PacketsSent field. +func (o *SyntheticsTestResultNetstats) SetPacketsSent(v int64) { + o.PacketsSent = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetstats) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Hops != nil { + toSerialize["hops"] = o.Hops + } + if o.Jitter != nil { + toSerialize["jitter"] = o.Jitter + } + if o.Latency != nil { + toSerialize["latency"] = o.Latency + } + if o.PacketLossPercentage != nil { + toSerialize["packet_loss_percentage"] = o.PacketLossPercentage + } + if o.PacketsReceived != nil { + toSerialize["packets_received"] = o.PacketsReceived + } + if o.PacketsSent != nil { + toSerialize["packets_sent"] = o.PacketsSent + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetstats) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Hops *SyntheticsTestResultNetstatsHops `json:"hops,omitempty"` + Jitter *float64 `json:"jitter,omitempty"` + Latency *SyntheticsTestResultNetworkLatency `json:"latency,omitempty"` + PacketLossPercentage *float64 `json:"packet_loss_percentage,omitempty"` + PacketsReceived *int64 `json:"packets_received,omitempty"` + PacketsSent *int64 `json:"packets_sent,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"hops", "jitter", "latency", "packet_loss_percentage", "packets_received", "packets_sent"}) + } else { + return err + } + + hasInvalidField := false + if all.Hops != nil && all.Hops.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Hops = all.Hops + o.Jitter = all.Jitter + if all.Latency != nil && all.Latency.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Latency = all.Latency + o.PacketLossPercentage = all.PacketLossPercentage + o.PacketsReceived = all.PacketsReceived + o.PacketsSent = all.PacketsSent + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_netstats_hops.go b/api/datadogV2/model_synthetics_test_result_netstats_hops.go new file mode 100644 index 00000000000..36455e19d99 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_netstats_hops.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetstatsHops Statistics about the number of hops for a network test. +type SyntheticsTestResultNetstatsHops struct { + // Average number of hops. + Avg *float64 `json:"avg,omitempty"` + // Maximum number of hops. + Max *int64 `json:"max,omitempty"` + // Minimum number of hops. + Min *int64 `json:"min,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetstatsHops instantiates a new SyntheticsTestResultNetstatsHops object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetstatsHops() *SyntheticsTestResultNetstatsHops { + this := SyntheticsTestResultNetstatsHops{} + return &this +} + +// NewSyntheticsTestResultNetstatsHopsWithDefaults instantiates a new SyntheticsTestResultNetstatsHops object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetstatsHopsWithDefaults() *SyntheticsTestResultNetstatsHops { + this := SyntheticsTestResultNetstatsHops{} + return &this +} + +// GetAvg returns the Avg field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstatsHops) GetAvg() float64 { + if o == nil || o.Avg == nil { + var ret float64 + return ret + } + return *o.Avg +} + +// GetAvgOk returns a tuple with the Avg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstatsHops) GetAvgOk() (*float64, bool) { + if o == nil || o.Avg == nil { + return nil, false + } + return o.Avg, true +} + +// HasAvg returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstatsHops) HasAvg() bool { + return o != nil && o.Avg != nil +} + +// SetAvg gets a reference to the given float64 and assigns it to the Avg field. +func (o *SyntheticsTestResultNetstatsHops) SetAvg(v float64) { + o.Avg = &v +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstatsHops) GetMax() int64 { + if o == nil || o.Max == nil { + var ret int64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstatsHops) GetMaxOk() (*int64, bool) { + if o == nil || o.Max == nil { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstatsHops) HasMax() bool { + return o != nil && o.Max != nil +} + +// SetMax gets a reference to the given int64 and assigns it to the Max field. +func (o *SyntheticsTestResultNetstatsHops) SetMax(v int64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetstatsHops) GetMin() int64 { + if o == nil || o.Min == nil { + var ret int64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetstatsHops) GetMinOk() (*int64, bool) { + if o == nil || o.Min == nil { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetstatsHops) HasMin() bool { + return o != nil && o.Min != nil +} + +// SetMin gets a reference to the given int64 and assigns it to the Min field. +func (o *SyntheticsTestResultNetstatsHops) SetMin(v int64) { + o.Min = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetstatsHops) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Avg != nil { + toSerialize["avg"] = o.Avg + } + if o.Max != nil { + toSerialize["max"] = o.Max + } + if o.Min != nil { + toSerialize["min"] = o.Min + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetstatsHops) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Avg *float64 `json:"avg,omitempty"` + Max *int64 `json:"max,omitempty"` + Min *int64 `json:"min,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"avg", "max", "min"}) + } else { + return err + } + o.Avg = all.Avg + o.Max = all.Max + o.Min = all.Min + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_network_latency.go b/api/datadogV2/model_synthetics_test_result_network_latency.go new file mode 100644 index 00000000000..cf708a185d8 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_network_latency.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultNetworkLatency Latency statistics for a network probe. +type SyntheticsTestResultNetworkLatency struct { + // Average latency in milliseconds. + Avg *float64 `json:"avg,omitempty"` + // Maximum latency in milliseconds. + Max *float64 `json:"max,omitempty"` + // Minimum latency in milliseconds. + Min *float64 `json:"min,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultNetworkLatency instantiates a new SyntheticsTestResultNetworkLatency object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultNetworkLatency() *SyntheticsTestResultNetworkLatency { + this := SyntheticsTestResultNetworkLatency{} + return &this +} + +// NewSyntheticsTestResultNetworkLatencyWithDefaults instantiates a new SyntheticsTestResultNetworkLatency object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultNetworkLatencyWithDefaults() *SyntheticsTestResultNetworkLatency { + this := SyntheticsTestResultNetworkLatency{} + return &this +} + +// GetAvg returns the Avg field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetworkLatency) GetAvg() float64 { + if o == nil || o.Avg == nil { + var ret float64 + return ret + } + return *o.Avg +} + +// GetAvgOk returns a tuple with the Avg field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetworkLatency) GetAvgOk() (*float64, bool) { + if o == nil || o.Avg == nil { + return nil, false + } + return o.Avg, true +} + +// HasAvg returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetworkLatency) HasAvg() bool { + return o != nil && o.Avg != nil +} + +// SetAvg gets a reference to the given float64 and assigns it to the Avg field. +func (o *SyntheticsTestResultNetworkLatency) SetAvg(v float64) { + o.Avg = &v +} + +// GetMax returns the Max field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetworkLatency) GetMax() float64 { + if o == nil || o.Max == nil { + var ret float64 + return ret + } + return *o.Max +} + +// GetMaxOk returns a tuple with the Max field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetworkLatency) GetMaxOk() (*float64, bool) { + if o == nil || o.Max == nil { + return nil, false + } + return o.Max, true +} + +// HasMax returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetworkLatency) HasMax() bool { + return o != nil && o.Max != nil +} + +// SetMax gets a reference to the given float64 and assigns it to the Max field. +func (o *SyntheticsTestResultNetworkLatency) SetMax(v float64) { + o.Max = &v +} + +// GetMin returns the Min field value if set, zero value otherwise. +func (o *SyntheticsTestResultNetworkLatency) GetMin() float64 { + if o == nil || o.Min == nil { + var ret float64 + return ret + } + return *o.Min +} + +// GetMinOk returns a tuple with the Min field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultNetworkLatency) GetMinOk() (*float64, bool) { + if o == nil || o.Min == nil { + return nil, false + } + return o.Min, true +} + +// HasMin returns a boolean if a field has been set. +func (o *SyntheticsTestResultNetworkLatency) HasMin() bool { + return o != nil && o.Min != nil +} + +// SetMin gets a reference to the given float64 and assigns it to the Min field. +func (o *SyntheticsTestResultNetworkLatency) SetMin(v float64) { + o.Min = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultNetworkLatency) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Avg != nil { + toSerialize["avg"] = o.Avg + } + if o.Max != nil { + toSerialize["max"] = o.Max + } + if o.Min != nil { + toSerialize["min"] = o.Min + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultNetworkLatency) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Avg *float64 `json:"avg,omitempty"` + Max *float64 `json:"max,omitempty"` + Min *float64 `json:"min,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"avg", "max", "min"}) + } else { + return err + } + o.Avg = all.Avg + o.Max = all.Max + o.Min = all.Min + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ocsp_certificate.go b/api/datadogV2/model_synthetics_test_result_ocsp_certificate.go new file mode 100644 index 00000000000..34e13a46973 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ocsp_certificate.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultOCSPCertificate Certificate details returned in an OCSP response. +type SyntheticsTestResultOCSPCertificate struct { + // Reason code for the revocation, when applicable. + RevocationReason *string `json:"revocation_reason,omitempty"` + // Unix timestamp (ms) of the revocation. + RevocationTime *int64 `json:"revocation_time,omitempty"` + // Serial number of the certificate. + SerialNumber *string `json:"serial_number,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultOCSPCertificate instantiates a new SyntheticsTestResultOCSPCertificate object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultOCSPCertificate() *SyntheticsTestResultOCSPCertificate { + this := SyntheticsTestResultOCSPCertificate{} + return &this +} + +// NewSyntheticsTestResultOCSPCertificateWithDefaults instantiates a new SyntheticsTestResultOCSPCertificate object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultOCSPCertificateWithDefaults() *SyntheticsTestResultOCSPCertificate { + this := SyntheticsTestResultOCSPCertificate{} + return &this +} + +// GetRevocationReason returns the RevocationReason field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPCertificate) GetRevocationReason() string { + if o == nil || o.RevocationReason == nil { + var ret string + return ret + } + return *o.RevocationReason +} + +// GetRevocationReasonOk returns a tuple with the RevocationReason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPCertificate) GetRevocationReasonOk() (*string, bool) { + if o == nil || o.RevocationReason == nil { + return nil, false + } + return o.RevocationReason, true +} + +// HasRevocationReason returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPCertificate) HasRevocationReason() bool { + return o != nil && o.RevocationReason != nil +} + +// SetRevocationReason gets a reference to the given string and assigns it to the RevocationReason field. +func (o *SyntheticsTestResultOCSPCertificate) SetRevocationReason(v string) { + o.RevocationReason = &v +} + +// GetRevocationTime returns the RevocationTime field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPCertificate) GetRevocationTime() int64 { + if o == nil || o.RevocationTime == nil { + var ret int64 + return ret + } + return *o.RevocationTime +} + +// GetRevocationTimeOk returns a tuple with the RevocationTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPCertificate) GetRevocationTimeOk() (*int64, bool) { + if o == nil || o.RevocationTime == nil { + return nil, false + } + return o.RevocationTime, true +} + +// HasRevocationTime returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPCertificate) HasRevocationTime() bool { + return o != nil && o.RevocationTime != nil +} + +// SetRevocationTime gets a reference to the given int64 and assigns it to the RevocationTime field. +func (o *SyntheticsTestResultOCSPCertificate) SetRevocationTime(v int64) { + o.RevocationTime = &v +} + +// GetSerialNumber returns the SerialNumber field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPCertificate) GetSerialNumber() string { + if o == nil || o.SerialNumber == nil { + var ret string + return ret + } + return *o.SerialNumber +} + +// GetSerialNumberOk returns a tuple with the SerialNumber field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPCertificate) GetSerialNumberOk() (*string, bool) { + if o == nil || o.SerialNumber == nil { + return nil, false + } + return o.SerialNumber, true +} + +// HasSerialNumber returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPCertificate) HasSerialNumber() bool { + return o != nil && o.SerialNumber != nil +} + +// SetSerialNumber gets a reference to the given string and assigns it to the SerialNumber field. +func (o *SyntheticsTestResultOCSPCertificate) SetSerialNumber(v string) { + o.SerialNumber = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultOCSPCertificate) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.RevocationReason != nil { + toSerialize["revocation_reason"] = o.RevocationReason + } + if o.RevocationTime != nil { + toSerialize["revocation_time"] = o.RevocationTime + } + if o.SerialNumber != nil { + toSerialize["serial_number"] = o.SerialNumber + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultOCSPCertificate) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + RevocationReason *string `json:"revocation_reason,omitempty"` + RevocationTime *int64 `json:"revocation_time,omitempty"` + SerialNumber *string `json:"serial_number,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"revocation_reason", "revocation_time", "serial_number"}) + } else { + return err + } + o.RevocationReason = all.RevocationReason + o.RevocationTime = all.RevocationTime + o.SerialNumber = all.SerialNumber + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ocsp_response.go b/api/datadogV2/model_synthetics_test_result_ocsp_response.go new file mode 100644 index 00000000000..ab2b7deb059 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ocsp_response.go @@ -0,0 +1,184 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultOCSPResponse OCSP response received while validating a certificate. +type SyntheticsTestResultOCSPResponse struct { + // Certificate details returned in an OCSP response. + Certificate *SyntheticsTestResultOCSPCertificate `json:"certificate,omitempty"` + // OCSP response status (for example, `good`, `revoked`, `unknown`). + Status *string `json:"status,omitempty"` + // OCSP response update timestamps. + Updates *SyntheticsTestResultOCSPUpdates `json:"updates,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultOCSPResponse instantiates a new SyntheticsTestResultOCSPResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultOCSPResponse() *SyntheticsTestResultOCSPResponse { + this := SyntheticsTestResultOCSPResponse{} + return &this +} + +// NewSyntheticsTestResultOCSPResponseWithDefaults instantiates a new SyntheticsTestResultOCSPResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultOCSPResponseWithDefaults() *SyntheticsTestResultOCSPResponse { + this := SyntheticsTestResultOCSPResponse{} + return &this +} + +// GetCertificate returns the Certificate field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPResponse) GetCertificate() SyntheticsTestResultOCSPCertificate { + if o == nil || o.Certificate == nil { + var ret SyntheticsTestResultOCSPCertificate + return ret + } + return *o.Certificate +} + +// GetCertificateOk returns a tuple with the Certificate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPResponse) GetCertificateOk() (*SyntheticsTestResultOCSPCertificate, bool) { + if o == nil || o.Certificate == nil { + return nil, false + } + return o.Certificate, true +} + +// HasCertificate returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPResponse) HasCertificate() bool { + return o != nil && o.Certificate != nil +} + +// SetCertificate gets a reference to the given SyntheticsTestResultOCSPCertificate and assigns it to the Certificate field. +func (o *SyntheticsTestResultOCSPResponse) SetCertificate(v SyntheticsTestResultOCSPCertificate) { + o.Certificate = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPResponse) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPResponse) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPResponse) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SyntheticsTestResultOCSPResponse) SetStatus(v string) { + o.Status = &v +} + +// GetUpdates returns the Updates field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPResponse) GetUpdates() SyntheticsTestResultOCSPUpdates { + if o == nil || o.Updates == nil { + var ret SyntheticsTestResultOCSPUpdates + return ret + } + return *o.Updates +} + +// GetUpdatesOk returns a tuple with the Updates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPResponse) GetUpdatesOk() (*SyntheticsTestResultOCSPUpdates, bool) { + if o == nil || o.Updates == nil { + return nil, false + } + return o.Updates, true +} + +// HasUpdates returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPResponse) HasUpdates() bool { + return o != nil && o.Updates != nil +} + +// SetUpdates gets a reference to the given SyntheticsTestResultOCSPUpdates and assigns it to the Updates field. +func (o *SyntheticsTestResultOCSPResponse) SetUpdates(v SyntheticsTestResultOCSPUpdates) { + o.Updates = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultOCSPResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Certificate != nil { + toSerialize["certificate"] = o.Certificate + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Updates != nil { + toSerialize["updates"] = o.Updates + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultOCSPResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Certificate *SyntheticsTestResultOCSPCertificate `json:"certificate,omitempty"` + Status *string `json:"status,omitempty"` + Updates *SyntheticsTestResultOCSPUpdates `json:"updates,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"certificate", "status", "updates"}) + } else { + return err + } + + hasInvalidField := false + if all.Certificate != nil && all.Certificate.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Certificate = all.Certificate + o.Status = all.Status + if all.Updates != nil && all.Updates.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Updates = all.Updates + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_ocsp_updates.go b/api/datadogV2/model_synthetics_test_result_ocsp_updates.go new file mode 100644 index 00000000000..02b27d26d6d --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_ocsp_updates.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultOCSPUpdates OCSP response update timestamps. +type SyntheticsTestResultOCSPUpdates struct { + // Unix timestamp (ms) of the next expected OCSP update. + NextUpdate *int64 `json:"next_update,omitempty"` + // Unix timestamp (ms) of when the OCSP response was produced. + ProducedAt *int64 `json:"produced_at,omitempty"` + // Unix timestamp (ms) of this OCSP update. + ThisUpdate *int64 `json:"this_update,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultOCSPUpdates instantiates a new SyntheticsTestResultOCSPUpdates object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultOCSPUpdates() *SyntheticsTestResultOCSPUpdates { + this := SyntheticsTestResultOCSPUpdates{} + return &this +} + +// NewSyntheticsTestResultOCSPUpdatesWithDefaults instantiates a new SyntheticsTestResultOCSPUpdates object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultOCSPUpdatesWithDefaults() *SyntheticsTestResultOCSPUpdates { + this := SyntheticsTestResultOCSPUpdates{} + return &this +} + +// GetNextUpdate returns the NextUpdate field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPUpdates) GetNextUpdate() int64 { + if o == nil || o.NextUpdate == nil { + var ret int64 + return ret + } + return *o.NextUpdate +} + +// GetNextUpdateOk returns a tuple with the NextUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPUpdates) GetNextUpdateOk() (*int64, bool) { + if o == nil || o.NextUpdate == nil { + return nil, false + } + return o.NextUpdate, true +} + +// HasNextUpdate returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPUpdates) HasNextUpdate() bool { + return o != nil && o.NextUpdate != nil +} + +// SetNextUpdate gets a reference to the given int64 and assigns it to the NextUpdate field. +func (o *SyntheticsTestResultOCSPUpdates) SetNextUpdate(v int64) { + o.NextUpdate = &v +} + +// GetProducedAt returns the ProducedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPUpdates) GetProducedAt() int64 { + if o == nil || o.ProducedAt == nil { + var ret int64 + return ret + } + return *o.ProducedAt +} + +// GetProducedAtOk returns a tuple with the ProducedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPUpdates) GetProducedAtOk() (*int64, bool) { + if o == nil || o.ProducedAt == nil { + return nil, false + } + return o.ProducedAt, true +} + +// HasProducedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPUpdates) HasProducedAt() bool { + return o != nil && o.ProducedAt != nil +} + +// SetProducedAt gets a reference to the given int64 and assigns it to the ProducedAt field. +func (o *SyntheticsTestResultOCSPUpdates) SetProducedAt(v int64) { + o.ProducedAt = &v +} + +// GetThisUpdate returns the ThisUpdate field value if set, zero value otherwise. +func (o *SyntheticsTestResultOCSPUpdates) GetThisUpdate() int64 { + if o == nil || o.ThisUpdate == nil { + var ret int64 + return ret + } + return *o.ThisUpdate +} + +// GetThisUpdateOk returns a tuple with the ThisUpdate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultOCSPUpdates) GetThisUpdateOk() (*int64, bool) { + if o == nil || o.ThisUpdate == nil { + return nil, false + } + return o.ThisUpdate, true +} + +// HasThisUpdate returns a boolean if a field has been set. +func (o *SyntheticsTestResultOCSPUpdates) HasThisUpdate() bool { + return o != nil && o.ThisUpdate != nil +} + +// SetThisUpdate gets a reference to the given int64 and assigns it to the ThisUpdate field. +func (o *SyntheticsTestResultOCSPUpdates) SetThisUpdate(v int64) { + o.ThisUpdate = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultOCSPUpdates) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.NextUpdate != nil { + toSerialize["next_update"] = o.NextUpdate + } + if o.ProducedAt != nil { + toSerialize["produced_at"] = o.ProducedAt + } + if o.ThisUpdate != nil { + toSerialize["this_update"] = o.ThisUpdate + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultOCSPUpdates) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + NextUpdate *int64 `json:"next_update,omitempty"` + ProducedAt *int64 `json:"produced_at,omitempty"` + ThisUpdate *int64 `json:"this_update,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"next_update", "produced_at", "this_update"}) + } else { + return err + } + o.NextUpdate = all.NextUpdate + o.ProducedAt = all.ProducedAt + o.ThisUpdate = all.ThisUpdate + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_parent_step.go b/api/datadogV2/model_synthetics_test_result_parent_step.go new file mode 100644 index 00000000000..943bdbe76b8 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_parent_step.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultParentStep Reference to the parent step of a sub-step. +type SyntheticsTestResultParentStep struct { + // Identifier of the parent step. + Id *string `json:"id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultParentStep instantiates a new SyntheticsTestResultParentStep object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultParentStep() *SyntheticsTestResultParentStep { + this := SyntheticsTestResultParentStep{} + return &this +} + +// NewSyntheticsTestResultParentStepWithDefaults instantiates a new SyntheticsTestResultParentStep object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultParentStepWithDefaults() *SyntheticsTestResultParentStep { + this := SyntheticsTestResultParentStep{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultParentStep) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultParentStep) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultParentStep) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultParentStep) SetId(v string) { + o.Id = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultParentStep) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultParentStep) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id"}) + } else { + return err + } + o.Id = all.Id + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_parent_test_.go b/api/datadogV2/model_synthetics_test_result_parent_test_.go new file mode 100644 index 00000000000..49343948c7f --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_parent_test_.go @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultParentTest Reference to the parent test of a sub-step. +type SyntheticsTestResultParentTest struct { + // Identifier of the parent test. + Id *string `json:"id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultParentTest instantiates a new SyntheticsTestResultParentTest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultParentTest() *SyntheticsTestResultParentTest { + this := SyntheticsTestResultParentTest{} + return &this +} + +// NewSyntheticsTestResultParentTestWithDefaults instantiates a new SyntheticsTestResultParentTest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultParentTestWithDefaults() *SyntheticsTestResultParentTest { + this := SyntheticsTestResultParentTest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultParentTest) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultParentTest) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultParentTest) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultParentTest) SetId(v string) { + o.Id = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultParentTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultParentTest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id"}) + } else { + return err + } + o.Id = all.Id + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_redirect.go b/api/datadogV2/model_synthetics_test_result_redirect.go new file mode 100644 index 00000000000..cc34aeb2dc5 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_redirect.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRedirect A redirect hop encountered while performing the request. +type SyntheticsTestResultRedirect struct { + // Target location of the redirect. + Location *string `json:"location,omitempty"` + // HTTP status code of the redirect response. + StatusCode *int64 `json:"status_code,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRedirect instantiates a new SyntheticsTestResultRedirect object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRedirect() *SyntheticsTestResultRedirect { + this := SyntheticsTestResultRedirect{} + return &this +} + +// NewSyntheticsTestResultRedirectWithDefaults instantiates a new SyntheticsTestResultRedirect object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRedirectWithDefaults() *SyntheticsTestResultRedirect { + this := SyntheticsTestResultRedirect{} + return &this +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *SyntheticsTestResultRedirect) GetLocation() string { + if o == nil || o.Location == nil { + var ret string + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRedirect) GetLocationOk() (*string, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *SyntheticsTestResultRedirect) HasLocation() bool { + return o != nil && o.Location != nil +} + +// SetLocation gets a reference to the given string and assigns it to the Location field. +func (o *SyntheticsTestResultRedirect) SetLocation(v string) { + o.Location = &v +} + +// GetStatusCode returns the StatusCode field value if set, zero value otherwise. +func (o *SyntheticsTestResultRedirect) GetStatusCode() int64 { + if o == nil || o.StatusCode == nil { + var ret int64 + return ret + } + return *o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRedirect) GetStatusCodeOk() (*int64, bool) { + if o == nil || o.StatusCode == nil { + return nil, false + } + return o.StatusCode, true +} + +// HasStatusCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultRedirect) HasStatusCode() bool { + return o != nil && o.StatusCode != nil +} + +// SetStatusCode gets a reference to the given int64 and assigns it to the StatusCode field. +func (o *SyntheticsTestResultRedirect) SetStatusCode(v int64) { + o.StatusCode = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRedirect) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.StatusCode != nil { + toSerialize["status_code"] = o.StatusCode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRedirect) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Location *string `json:"location,omitempty"` + StatusCode *int64 `json:"status_code,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"location", "status_code"}) + } else { + return err + } + o.Location = all.Location + o.StatusCode = all.StatusCode + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_relationship_test_.go b/api/datadogV2/model_synthetics_test_result_relationship_test_.go new file mode 100644 index 00000000000..caaefe08329 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_relationship_test_.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRelationshipTest Relationship to the Synthetic test. +type SyntheticsTestResultRelationshipTest struct { + // Data for the test relationship. + Data *SyntheticsTestResultRelationshipTestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRelationshipTest instantiates a new SyntheticsTestResultRelationshipTest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRelationshipTest() *SyntheticsTestResultRelationshipTest { + this := SyntheticsTestResultRelationshipTest{} + return &this +} + +// NewSyntheticsTestResultRelationshipTestWithDefaults instantiates a new SyntheticsTestResultRelationshipTest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRelationshipTestWithDefaults() *SyntheticsTestResultRelationshipTest { + this := SyntheticsTestResultRelationshipTest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SyntheticsTestResultRelationshipTest) GetData() SyntheticsTestResultRelationshipTestData { + if o == nil || o.Data == nil { + var ret SyntheticsTestResultRelationshipTestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRelationshipTest) GetDataOk() (*SyntheticsTestResultRelationshipTestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SyntheticsTestResultRelationshipTest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given SyntheticsTestResultRelationshipTestData and assigns it to the Data field. +func (o *SyntheticsTestResultRelationshipTest) SetData(v SyntheticsTestResultRelationshipTestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRelationshipTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRelationshipTest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SyntheticsTestResultRelationshipTestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_relationship_test_data.go b/api/datadogV2/model_synthetics_test_result_relationship_test_data.go new file mode 100644 index 00000000000..33d6047b981 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_relationship_test_data.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRelationshipTestData Data for the test relationship. +type SyntheticsTestResultRelationshipTestData struct { + // The public ID of the test. + Id *string `json:"id,omitempty"` + // Type of the related resource. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRelationshipTestData instantiates a new SyntheticsTestResultRelationshipTestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRelationshipTestData() *SyntheticsTestResultRelationshipTestData { + this := SyntheticsTestResultRelationshipTestData{} + return &this +} + +// NewSyntheticsTestResultRelationshipTestDataWithDefaults instantiates a new SyntheticsTestResultRelationshipTestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRelationshipTestDataWithDefaults() *SyntheticsTestResultRelationshipTestData { + this := SyntheticsTestResultRelationshipTestData{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultRelationshipTestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRelationshipTestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultRelationshipTestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultRelationshipTestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultRelationshipTestData) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRelationshipTestData) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultRelationshipTestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultRelationshipTestData) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRelationshipTestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRelationshipTestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "type"}) + } else { + return err + } + o.Id = all.Id + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_relationships.go b/api/datadogV2/model_synthetics_test_result_relationships.go new file mode 100644 index 00000000000..e0de9b10f87 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_relationships.go @@ -0,0 +1,111 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRelationships Relationships for a Synthetic test result. +type SyntheticsTestResultRelationships struct { + // Relationship to the Synthetic test. + Test *SyntheticsTestResultRelationshipTest `json:"test,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRelationships instantiates a new SyntheticsTestResultRelationships object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRelationships() *SyntheticsTestResultRelationships { + this := SyntheticsTestResultRelationships{} + return &this +} + +// NewSyntheticsTestResultRelationshipsWithDefaults instantiates a new SyntheticsTestResultRelationships object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRelationshipsWithDefaults() *SyntheticsTestResultRelationships { + this := SyntheticsTestResultRelationships{} + return &this +} + +// GetTest returns the Test field value if set, zero value otherwise. +func (o *SyntheticsTestResultRelationships) GetTest() SyntheticsTestResultRelationshipTest { + if o == nil || o.Test == nil { + var ret SyntheticsTestResultRelationshipTest + return ret + } + return *o.Test +} + +// GetTestOk returns a tuple with the Test field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRelationships) GetTestOk() (*SyntheticsTestResultRelationshipTest, bool) { + if o == nil || o.Test == nil { + return nil, false + } + return o.Test, true +} + +// HasTest returns a boolean if a field has been set. +func (o *SyntheticsTestResultRelationships) HasTest() bool { + return o != nil && o.Test != nil +} + +// SetTest gets a reference to the given SyntheticsTestResultRelationshipTest and assigns it to the Test field. +func (o *SyntheticsTestResultRelationships) SetTest(v SyntheticsTestResultRelationshipTest) { + o.Test = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRelationships) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Test != nil { + toSerialize["test"] = o.Test + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRelationships) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Test *SyntheticsTestResultRelationshipTest `json:"test,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"test"}) + } else { + return err + } + + hasInvalidField := false + if all.Test != nil && all.Test.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Test = all.Test + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_request_info.go b/api/datadogV2/model_synthetics_test_result_request_info.go new file mode 100644 index 00000000000..3100a185e0c --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_request_info.go @@ -0,0 +1,802 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRequestInfo Details of the outgoing request made during the test execution. +type SyntheticsTestResultRequestInfo struct { + // Whether insecure certificates are allowed for this request. + AllowInsecure *bool `json:"allow_insecure,omitempty"` + // Body sent with the request. + Body *string `json:"body,omitempty"` + // gRPC call type (for example, `unary`, `healthCheck`, or `reflection`). + CallType *string `json:"call_type,omitempty"` + // Destination service for a Network Path test. + DestinationService *string `json:"destination_service,omitempty"` + // DNS server used to resolve the target host. + DnsServer *string `json:"dns_server,omitempty"` + // Port of the DNS server used for resolution. + DnsServerPort *int64 `json:"dns_server_port,omitempty"` + // Number of end-to-end probe queries issued. + E2eQueries *int64 `json:"e2e_queries,omitempty"` + // Files attached to the request. + Files []SyntheticsTestResultFileRef `json:"files,omitempty"` + // Headers sent with the request. + Headers map[string]interface{} `json:"headers,omitempty"` + // Host targeted by the request. + Host *string `json:"host,omitempty"` + // Maximum TTL for network probe packets. + MaxTtl *int64 `json:"max_ttl,omitempty"` + // Message sent with the request (for WebSocket/TCP/UDP tests). + Message *string `json:"message,omitempty"` + // HTTP method used for the request. + Method *string `json:"method,omitempty"` + // Whether the response body was not saved. + NoSavingResponseBody *bool `json:"no_saving_response_body,omitempty"` + // Port targeted by the request. Can be a number or a string variable reference. + Port interface{} `json:"port,omitempty"` + // Service name targeted by the request (for gRPC tests). + Service *string `json:"service,omitempty"` + // Source service for a Network Path test. + SourceService *string `json:"source_service,omitempty"` + // Request timeout in milliseconds. + Timeout *int64 `json:"timeout,omitempty"` + // Name of the MCP tool called (MCP tests only). + ToolName *string `json:"tool_name,omitempty"` + // Number of traceroute probe queries issued. + TracerouteQueries *int64 `json:"traceroute_queries,omitempty"` + // URL targeted by the request. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRequestInfo instantiates a new SyntheticsTestResultRequestInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRequestInfo() *SyntheticsTestResultRequestInfo { + this := SyntheticsTestResultRequestInfo{} + return &this +} + +// NewSyntheticsTestResultRequestInfoWithDefaults instantiates a new SyntheticsTestResultRequestInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRequestInfoWithDefaults() *SyntheticsTestResultRequestInfo { + this := SyntheticsTestResultRequestInfo{} + return &this +} + +// GetAllowInsecure returns the AllowInsecure field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetAllowInsecure() bool { + if o == nil || o.AllowInsecure == nil { + var ret bool + return ret + } + return *o.AllowInsecure +} + +// GetAllowInsecureOk returns a tuple with the AllowInsecure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetAllowInsecureOk() (*bool, bool) { + if o == nil || o.AllowInsecure == nil { + return nil, false + } + return o.AllowInsecure, true +} + +// HasAllowInsecure returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasAllowInsecure() bool { + return o != nil && o.AllowInsecure != nil +} + +// SetAllowInsecure gets a reference to the given bool and assigns it to the AllowInsecure field. +func (o *SyntheticsTestResultRequestInfo) SetAllowInsecure(v bool) { + o.AllowInsecure = &v +} + +// GetBody returns the Body field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetBody() string { + if o == nil || o.Body == nil { + var ret string + return ret + } + return *o.Body +} + +// GetBodyOk returns a tuple with the Body field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetBodyOk() (*string, bool) { + if o == nil || o.Body == nil { + return nil, false + } + return o.Body, true +} + +// HasBody returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasBody() bool { + return o != nil && o.Body != nil +} + +// SetBody gets a reference to the given string and assigns it to the Body field. +func (o *SyntheticsTestResultRequestInfo) SetBody(v string) { + o.Body = &v +} + +// GetCallType returns the CallType field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetCallType() string { + if o == nil || o.CallType == nil { + var ret string + return ret + } + return *o.CallType +} + +// GetCallTypeOk returns a tuple with the CallType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetCallTypeOk() (*string, bool) { + if o == nil || o.CallType == nil { + return nil, false + } + return o.CallType, true +} + +// HasCallType returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasCallType() bool { + return o != nil && o.CallType != nil +} + +// SetCallType gets a reference to the given string and assigns it to the CallType field. +func (o *SyntheticsTestResultRequestInfo) SetCallType(v string) { + o.CallType = &v +} + +// GetDestinationService returns the DestinationService field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetDestinationService() string { + if o == nil || o.DestinationService == nil { + var ret string + return ret + } + return *o.DestinationService +} + +// GetDestinationServiceOk returns a tuple with the DestinationService field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetDestinationServiceOk() (*string, bool) { + if o == nil || o.DestinationService == nil { + return nil, false + } + return o.DestinationService, true +} + +// HasDestinationService returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasDestinationService() bool { + return o != nil && o.DestinationService != nil +} + +// SetDestinationService gets a reference to the given string and assigns it to the DestinationService field. +func (o *SyntheticsTestResultRequestInfo) SetDestinationService(v string) { + o.DestinationService = &v +} + +// GetDnsServer returns the DnsServer field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetDnsServer() string { + if o == nil || o.DnsServer == nil { + var ret string + return ret + } + return *o.DnsServer +} + +// GetDnsServerOk returns a tuple with the DnsServer field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetDnsServerOk() (*string, bool) { + if o == nil || o.DnsServer == nil { + return nil, false + } + return o.DnsServer, true +} + +// HasDnsServer returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasDnsServer() bool { + return o != nil && o.DnsServer != nil +} + +// SetDnsServer gets a reference to the given string and assigns it to the DnsServer field. +func (o *SyntheticsTestResultRequestInfo) SetDnsServer(v string) { + o.DnsServer = &v +} + +// GetDnsServerPort returns the DnsServerPort field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetDnsServerPort() int64 { + if o == nil || o.DnsServerPort == nil { + var ret int64 + return ret + } + return *o.DnsServerPort +} + +// GetDnsServerPortOk returns a tuple with the DnsServerPort field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetDnsServerPortOk() (*int64, bool) { + if o == nil || o.DnsServerPort == nil { + return nil, false + } + return o.DnsServerPort, true +} + +// HasDnsServerPort returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasDnsServerPort() bool { + return o != nil && o.DnsServerPort != nil +} + +// SetDnsServerPort gets a reference to the given int64 and assigns it to the DnsServerPort field. +func (o *SyntheticsTestResultRequestInfo) SetDnsServerPort(v int64) { + o.DnsServerPort = &v +} + +// GetE2eQueries returns the E2eQueries field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetE2eQueries() int64 { + if o == nil || o.E2eQueries == nil { + var ret int64 + return ret + } + return *o.E2eQueries +} + +// GetE2eQueriesOk returns a tuple with the E2eQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetE2eQueriesOk() (*int64, bool) { + if o == nil || o.E2eQueries == nil { + return nil, false + } + return o.E2eQueries, true +} + +// HasE2eQueries returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasE2eQueries() bool { + return o != nil && o.E2eQueries != nil +} + +// SetE2eQueries gets a reference to the given int64 and assigns it to the E2eQueries field. +func (o *SyntheticsTestResultRequestInfo) SetE2eQueries(v int64) { + o.E2eQueries = &v +} + +// GetFiles returns the Files field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetFiles() []SyntheticsTestResultFileRef { + if o == nil || o.Files == nil { + var ret []SyntheticsTestResultFileRef + return ret + } + return o.Files +} + +// GetFilesOk returns a tuple with the Files field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetFilesOk() (*[]SyntheticsTestResultFileRef, bool) { + if o == nil || o.Files == nil { + return nil, false + } + return &o.Files, true +} + +// HasFiles returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasFiles() bool { + return o != nil && o.Files != nil +} + +// SetFiles gets a reference to the given []SyntheticsTestResultFileRef and assigns it to the Files field. +func (o *SyntheticsTestResultRequestInfo) SetFiles(v []SyntheticsTestResultFileRef) { + o.Files = v +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetHeaders() map[string]interface{} { + if o == nil || o.Headers == nil { + var ret map[string]interface{} + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetHeadersOk() (*map[string]interface{}, bool) { + if o == nil || o.Headers == nil { + return nil, false + } + return &o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasHeaders() bool { + return o != nil && o.Headers != nil +} + +// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. +func (o *SyntheticsTestResultRequestInfo) SetHeaders(v map[string]interface{}) { + o.Headers = v +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetHost() string { + if o == nil || o.Host == nil { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetHostOk() (*string, bool) { + if o == nil || o.Host == nil { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasHost() bool { + return o != nil && o.Host != nil +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *SyntheticsTestResultRequestInfo) SetHost(v string) { + o.Host = &v +} + +// GetMaxTtl returns the MaxTtl field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetMaxTtl() int64 { + if o == nil || o.MaxTtl == nil { + var ret int64 + return ret + } + return *o.MaxTtl +} + +// GetMaxTtlOk returns a tuple with the MaxTtl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetMaxTtlOk() (*int64, bool) { + if o == nil || o.MaxTtl == nil { + return nil, false + } + return o.MaxTtl, true +} + +// HasMaxTtl returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasMaxTtl() bool { + return o != nil && o.MaxTtl != nil +} + +// SetMaxTtl gets a reference to the given int64 and assigns it to the MaxTtl field. +func (o *SyntheticsTestResultRequestInfo) SetMaxTtl(v int64) { + o.MaxTtl = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SyntheticsTestResultRequestInfo) SetMessage(v string) { + o.Message = &v +} + +// GetMethod returns the Method field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetMethod() string { + if o == nil || o.Method == nil { + var ret string + return ret + } + return *o.Method +} + +// GetMethodOk returns a tuple with the Method field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetMethodOk() (*string, bool) { + if o == nil || o.Method == nil { + return nil, false + } + return o.Method, true +} + +// HasMethod returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasMethod() bool { + return o != nil && o.Method != nil +} + +// SetMethod gets a reference to the given string and assigns it to the Method field. +func (o *SyntheticsTestResultRequestInfo) SetMethod(v string) { + o.Method = &v +} + +// GetNoSavingResponseBody returns the NoSavingResponseBody field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetNoSavingResponseBody() bool { + if o == nil || o.NoSavingResponseBody == nil { + var ret bool + return ret + } + return *o.NoSavingResponseBody +} + +// GetNoSavingResponseBodyOk returns a tuple with the NoSavingResponseBody field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetNoSavingResponseBodyOk() (*bool, bool) { + if o == nil || o.NoSavingResponseBody == nil { + return nil, false + } + return o.NoSavingResponseBody, true +} + +// HasNoSavingResponseBody returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasNoSavingResponseBody() bool { + return o != nil && o.NoSavingResponseBody != nil +} + +// SetNoSavingResponseBody gets a reference to the given bool and assigns it to the NoSavingResponseBody field. +func (o *SyntheticsTestResultRequestInfo) SetNoSavingResponseBody(v bool) { + o.NoSavingResponseBody = &v +} + +// GetPort returns the Port field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetPort() interface{} { + if o == nil || o.Port == nil { + var ret interface{} + return ret + } + return o.Port +} + +// GetPortOk returns a tuple with the Port field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetPortOk() (*interface{}, bool) { + if o == nil || o.Port == nil { + return nil, false + } + return &o.Port, true +} + +// HasPort returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasPort() bool { + return o != nil && o.Port != nil +} + +// SetPort gets a reference to the given interface{} and assigns it to the Port field. +func (o *SyntheticsTestResultRequestInfo) SetPort(v interface{}) { + o.Port = v +} + +// GetService returns the Service field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetService() string { + if o == nil || o.Service == nil { + var ret string + return ret + } + return *o.Service +} + +// GetServiceOk returns a tuple with the Service field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetServiceOk() (*string, bool) { + if o == nil || o.Service == nil { + return nil, false + } + return o.Service, true +} + +// HasService returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasService() bool { + return o != nil && o.Service != nil +} + +// SetService gets a reference to the given string and assigns it to the Service field. +func (o *SyntheticsTestResultRequestInfo) SetService(v string) { + o.Service = &v +} + +// GetSourceService returns the SourceService field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetSourceService() string { + if o == nil || o.SourceService == nil { + var ret string + return ret + } + return *o.SourceService +} + +// GetSourceServiceOk returns a tuple with the SourceService field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetSourceServiceOk() (*string, bool) { + if o == nil || o.SourceService == nil { + return nil, false + } + return o.SourceService, true +} + +// HasSourceService returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasSourceService() bool { + return o != nil && o.SourceService != nil +} + +// SetSourceService gets a reference to the given string and assigns it to the SourceService field. +func (o *SyntheticsTestResultRequestInfo) SetSourceService(v string) { + o.SourceService = &v +} + +// GetTimeout returns the Timeout field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetTimeout() int64 { + if o == nil || o.Timeout == nil { + var ret int64 + return ret + } + return *o.Timeout +} + +// GetTimeoutOk returns a tuple with the Timeout field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetTimeoutOk() (*int64, bool) { + if o == nil || o.Timeout == nil { + return nil, false + } + return o.Timeout, true +} + +// HasTimeout returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasTimeout() bool { + return o != nil && o.Timeout != nil +} + +// SetTimeout gets a reference to the given int64 and assigns it to the Timeout field. +func (o *SyntheticsTestResultRequestInfo) SetTimeout(v int64) { + o.Timeout = &v +} + +// GetToolName returns the ToolName field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetToolName() string { + if o == nil || o.ToolName == nil { + var ret string + return ret + } + return *o.ToolName +} + +// GetToolNameOk returns a tuple with the ToolName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetToolNameOk() (*string, bool) { + if o == nil || o.ToolName == nil { + return nil, false + } + return o.ToolName, true +} + +// HasToolName returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasToolName() bool { + return o != nil && o.ToolName != nil +} + +// SetToolName gets a reference to the given string and assigns it to the ToolName field. +func (o *SyntheticsTestResultRequestInfo) SetToolName(v string) { + o.ToolName = &v +} + +// GetTracerouteQueries returns the TracerouteQueries field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetTracerouteQueries() int64 { + if o == nil || o.TracerouteQueries == nil { + var ret int64 + return ret + } + return *o.TracerouteQueries +} + +// GetTracerouteQueriesOk returns a tuple with the TracerouteQueries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetTracerouteQueriesOk() (*int64, bool) { + if o == nil || o.TracerouteQueries == nil { + return nil, false + } + return o.TracerouteQueries, true +} + +// HasTracerouteQueries returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasTracerouteQueries() bool { + return o != nil && o.TracerouteQueries != nil +} + +// SetTracerouteQueries gets a reference to the given int64 and assigns it to the TracerouteQueries field. +func (o *SyntheticsTestResultRequestInfo) SetTracerouteQueries(v int64) { + o.TracerouteQueries = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultRequestInfo) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRequestInfo) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultRequestInfo) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultRequestInfo) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRequestInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AllowInsecure != nil { + toSerialize["allow_insecure"] = o.AllowInsecure + } + if o.Body != nil { + toSerialize["body"] = o.Body + } + if o.CallType != nil { + toSerialize["call_type"] = o.CallType + } + if o.DestinationService != nil { + toSerialize["destination_service"] = o.DestinationService + } + if o.DnsServer != nil { + toSerialize["dns_server"] = o.DnsServer + } + if o.DnsServerPort != nil { + toSerialize["dns_server_port"] = o.DnsServerPort + } + if o.E2eQueries != nil { + toSerialize["e2e_queries"] = o.E2eQueries + } + if o.Files != nil { + toSerialize["files"] = o.Files + } + if o.Headers != nil { + toSerialize["headers"] = o.Headers + } + if o.Host != nil { + toSerialize["host"] = o.Host + } + if o.MaxTtl != nil { + toSerialize["max_ttl"] = o.MaxTtl + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Method != nil { + toSerialize["method"] = o.Method + } + if o.NoSavingResponseBody != nil { + toSerialize["no_saving_response_body"] = o.NoSavingResponseBody + } + if o.Port != nil { + toSerialize["port"] = o.Port + } + if o.Service != nil { + toSerialize["service"] = o.Service + } + if o.SourceService != nil { + toSerialize["source_service"] = o.SourceService + } + if o.Timeout != nil { + toSerialize["timeout"] = o.Timeout + } + if o.ToolName != nil { + toSerialize["tool_name"] = o.ToolName + } + if o.TracerouteQueries != nil { + toSerialize["traceroute_queries"] = o.TracerouteQueries + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRequestInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AllowInsecure *bool `json:"allow_insecure,omitempty"` + Body *string `json:"body,omitempty"` + CallType *string `json:"call_type,omitempty"` + DestinationService *string `json:"destination_service,omitempty"` + DnsServer *string `json:"dns_server,omitempty"` + DnsServerPort *int64 `json:"dns_server_port,omitempty"` + E2eQueries *int64 `json:"e2e_queries,omitempty"` + Files []SyntheticsTestResultFileRef `json:"files,omitempty"` + Headers map[string]interface{} `json:"headers,omitempty"` + Host *string `json:"host,omitempty"` + MaxTtl *int64 `json:"max_ttl,omitempty"` + Message *string `json:"message,omitempty"` + Method *string `json:"method,omitempty"` + NoSavingResponseBody *bool `json:"no_saving_response_body,omitempty"` + Port interface{} `json:"port,omitempty"` + Service *string `json:"service,omitempty"` + SourceService *string `json:"source_service,omitempty"` + Timeout *int64 `json:"timeout,omitempty"` + ToolName *string `json:"tool_name,omitempty"` + TracerouteQueries *int64 `json:"traceroute_queries,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"allow_insecure", "body", "call_type", "destination_service", "dns_server", "dns_server_port", "e2e_queries", "files", "headers", "host", "max_ttl", "message", "method", "no_saving_response_body", "port", "service", "source_service", "timeout", "tool_name", "traceroute_queries", "url"}) + } else { + return err + } + o.AllowInsecure = all.AllowInsecure + o.Body = all.Body + o.CallType = all.CallType + o.DestinationService = all.DestinationService + o.DnsServer = all.DnsServer + o.DnsServerPort = all.DnsServerPort + o.E2eQueries = all.E2eQueries + o.Files = all.Files + o.Headers = all.Headers + o.Host = all.Host + o.MaxTtl = all.MaxTtl + o.Message = all.Message + o.Method = all.Method + o.NoSavingResponseBody = all.NoSavingResponseBody + o.Port = all.Port + o.Service = all.Service + o.SourceService = all.SourceService + o.Timeout = all.Timeout + o.ToolName = all.ToolName + o.TracerouteQueries = all.TracerouteQueries + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_response.go b/api/datadogV2/model_synthetics_test_result_response.go new file mode 100644 index 00000000000..0d7b751c39d --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_response.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultResponse Response object for a Synthetic test result. +type SyntheticsTestResultResponse struct { + // Wrapper object for a Synthetic test result. + Data *SyntheticsTestResultData `json:"data,omitempty"` + // Array of included related resources, such as the test definition. + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultResponse instantiates a new SyntheticsTestResultResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultResponse() *SyntheticsTestResultResponse { + this := SyntheticsTestResultResponse{} + return &this +} + +// NewSyntheticsTestResultResponseWithDefaults instantiates a new SyntheticsTestResultResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultResponseWithDefaults() *SyntheticsTestResultResponse { + this := SyntheticsTestResultResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponse) GetData() SyntheticsTestResultData { + if o == nil || o.Data == nil { + var ret SyntheticsTestResultData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponse) GetDataOk() (*SyntheticsTestResultData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given SyntheticsTestResultData and assigns it to the Data field. +func (o *SyntheticsTestResultResponse) SetData(v SyntheticsTestResultData) { + o.Data = &v +} + +// GetIncluded returns the Included field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponse) GetIncluded() []SyntheticsTestResultIncludedItem { + if o == nil || o.Included == nil { + var ret []SyntheticsTestResultIncludedItem + return ret + } + return o.Included +} + +// GetIncludedOk returns a tuple with the Included field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponse) GetIncludedOk() (*[]SyntheticsTestResultIncludedItem, bool) { + if o == nil || o.Included == nil { + return nil, false + } + return &o.Included, true +} + +// HasIncluded returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponse) HasIncluded() bool { + return o != nil && o.Included != nil +} + +// SetIncluded gets a reference to the given []SyntheticsTestResultIncludedItem and assigns it to the Included field. +func (o *SyntheticsTestResultResponse) SetIncluded(v []SyntheticsTestResultIncludedItem) { + o.Included = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + if o.Included != nil { + toSerialize["included"] = o.Included + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *SyntheticsTestResultData `json:"data,omitempty"` + Included []SyntheticsTestResultIncludedItem `json:"included,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data", "included"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + o.Included = all.Included + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_response_info.go b/api/datadogV2/model_synthetics_test_result_response_info.go new file mode 100644 index 00000000000..c798c59fee8 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_response_info.go @@ -0,0 +1,712 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultResponseInfo Details of the response received during the test execution. +type SyntheticsTestResultResponseInfo struct { + // Body of the response. + Body *string `json:"body,omitempty"` + // Compressed representation of the response body. + BodyCompressed *string `json:"body_compressed,omitempty"` + // Hashes computed over the response body. + BodyHashes *string `json:"body_hashes,omitempty"` + // Size of the response body in bytes. + BodySize *int64 `json:"body_size,omitempty"` + // Cache-related response headers. + CacheHeaders map[string]string `json:"cache_headers,omitempty"` + // CDN provider details inferred from response headers. + Cdn *SyntheticsTestResultCdnProviderInfo `json:"cdn,omitempty"` + // WebSocket close frame information for WebSocket test responses. + Close *SyntheticsTestResultWebSocketClose `json:"close,omitempty"` + // Compressed representation of the response message. + CompressedMessage *string `json:"compressed_message,omitempty"` + // Response headers. + Headers map[string]interface{} `json:"headers,omitempty"` + // Health check information returned from a gRPC health check call. + Healthcheck *SyntheticsTestResultHealthCheck `json:"healthcheck,omitempty"` + // HTTP version of the response. + HttpVersion *string `json:"http_version,omitempty"` + // Whether the response body was truncated. + IsBodyTruncated *bool `json:"is_body_truncated,omitempty"` + // Whether the response message was truncated. + IsMessageTruncated *bool `json:"is_message_truncated,omitempty"` + // Message received in the response (for WebSocket/TCP/UDP tests). + Message *string `json:"message,omitempty"` + // Additional metadata returned with the response. + Metadata map[string]string `json:"metadata,omitempty"` + // DNS records returned in the response (DNS tests only). + Records []SyntheticsTestResultDnsRecord `json:"records,omitempty"` + // Redirect hops encountered while performing the request. + Redirects []SyntheticsTestResultRedirect `json:"redirects,omitempty"` + // HTTP status code of the response. + StatusCode *int64 `json:"status_code,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultResponseInfo instantiates a new SyntheticsTestResultResponseInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultResponseInfo() *SyntheticsTestResultResponseInfo { + this := SyntheticsTestResultResponseInfo{} + return &this +} + +// NewSyntheticsTestResultResponseInfoWithDefaults instantiates a new SyntheticsTestResultResponseInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultResponseInfoWithDefaults() *SyntheticsTestResultResponseInfo { + this := SyntheticsTestResultResponseInfo{} + return &this +} + +// GetBody returns the Body field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetBody() string { + if o == nil || o.Body == nil { + var ret string + return ret + } + return *o.Body +} + +// GetBodyOk returns a tuple with the Body field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetBodyOk() (*string, bool) { + if o == nil || o.Body == nil { + return nil, false + } + return o.Body, true +} + +// HasBody returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasBody() bool { + return o != nil && o.Body != nil +} + +// SetBody gets a reference to the given string and assigns it to the Body field. +func (o *SyntheticsTestResultResponseInfo) SetBody(v string) { + o.Body = &v +} + +// GetBodyCompressed returns the BodyCompressed field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetBodyCompressed() string { + if o == nil || o.BodyCompressed == nil { + var ret string + return ret + } + return *o.BodyCompressed +} + +// GetBodyCompressedOk returns a tuple with the BodyCompressed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetBodyCompressedOk() (*string, bool) { + if o == nil || o.BodyCompressed == nil { + return nil, false + } + return o.BodyCompressed, true +} + +// HasBodyCompressed returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasBodyCompressed() bool { + return o != nil && o.BodyCompressed != nil +} + +// SetBodyCompressed gets a reference to the given string and assigns it to the BodyCompressed field. +func (o *SyntheticsTestResultResponseInfo) SetBodyCompressed(v string) { + o.BodyCompressed = &v +} + +// GetBodyHashes returns the BodyHashes field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetBodyHashes() string { + if o == nil || o.BodyHashes == nil { + var ret string + return ret + } + return *o.BodyHashes +} + +// GetBodyHashesOk returns a tuple with the BodyHashes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetBodyHashesOk() (*string, bool) { + if o == nil || o.BodyHashes == nil { + return nil, false + } + return o.BodyHashes, true +} + +// HasBodyHashes returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasBodyHashes() bool { + return o != nil && o.BodyHashes != nil +} + +// SetBodyHashes gets a reference to the given string and assigns it to the BodyHashes field. +func (o *SyntheticsTestResultResponseInfo) SetBodyHashes(v string) { + o.BodyHashes = &v +} + +// GetBodySize returns the BodySize field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetBodySize() int64 { + if o == nil || o.BodySize == nil { + var ret int64 + return ret + } + return *o.BodySize +} + +// GetBodySizeOk returns a tuple with the BodySize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetBodySizeOk() (*int64, bool) { + if o == nil || o.BodySize == nil { + return nil, false + } + return o.BodySize, true +} + +// HasBodySize returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasBodySize() bool { + return o != nil && o.BodySize != nil +} + +// SetBodySize gets a reference to the given int64 and assigns it to the BodySize field. +func (o *SyntheticsTestResultResponseInfo) SetBodySize(v int64) { + o.BodySize = &v +} + +// GetCacheHeaders returns the CacheHeaders field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetCacheHeaders() map[string]string { + if o == nil || o.CacheHeaders == nil { + var ret map[string]string + return ret + } + return o.CacheHeaders +} + +// GetCacheHeadersOk returns a tuple with the CacheHeaders field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetCacheHeadersOk() (*map[string]string, bool) { + if o == nil || o.CacheHeaders == nil { + return nil, false + } + return &o.CacheHeaders, true +} + +// HasCacheHeaders returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasCacheHeaders() bool { + return o != nil && o.CacheHeaders != nil +} + +// SetCacheHeaders gets a reference to the given map[string]string and assigns it to the CacheHeaders field. +func (o *SyntheticsTestResultResponseInfo) SetCacheHeaders(v map[string]string) { + o.CacheHeaders = v +} + +// GetCdn returns the Cdn field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetCdn() SyntheticsTestResultCdnProviderInfo { + if o == nil || o.Cdn == nil { + var ret SyntheticsTestResultCdnProviderInfo + return ret + } + return *o.Cdn +} + +// GetCdnOk returns a tuple with the Cdn field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetCdnOk() (*SyntheticsTestResultCdnProviderInfo, bool) { + if o == nil || o.Cdn == nil { + return nil, false + } + return o.Cdn, true +} + +// HasCdn returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasCdn() bool { + return o != nil && o.Cdn != nil +} + +// SetCdn gets a reference to the given SyntheticsTestResultCdnProviderInfo and assigns it to the Cdn field. +func (o *SyntheticsTestResultResponseInfo) SetCdn(v SyntheticsTestResultCdnProviderInfo) { + o.Cdn = &v +} + +// GetClose returns the Close field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetClose() SyntheticsTestResultWebSocketClose { + if o == nil || o.Close == nil { + var ret SyntheticsTestResultWebSocketClose + return ret + } + return *o.Close +} + +// GetCloseOk returns a tuple with the Close field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetCloseOk() (*SyntheticsTestResultWebSocketClose, bool) { + if o == nil || o.Close == nil { + return nil, false + } + return o.Close, true +} + +// HasClose returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasClose() bool { + return o != nil && o.Close != nil +} + +// SetClose gets a reference to the given SyntheticsTestResultWebSocketClose and assigns it to the Close field. +func (o *SyntheticsTestResultResponseInfo) SetClose(v SyntheticsTestResultWebSocketClose) { + o.Close = &v +} + +// GetCompressedMessage returns the CompressedMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetCompressedMessage() string { + if o == nil || o.CompressedMessage == nil { + var ret string + return ret + } + return *o.CompressedMessage +} + +// GetCompressedMessageOk returns a tuple with the CompressedMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetCompressedMessageOk() (*string, bool) { + if o == nil || o.CompressedMessage == nil { + return nil, false + } + return o.CompressedMessage, true +} + +// HasCompressedMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasCompressedMessage() bool { + return o != nil && o.CompressedMessage != nil +} + +// SetCompressedMessage gets a reference to the given string and assigns it to the CompressedMessage field. +func (o *SyntheticsTestResultResponseInfo) SetCompressedMessage(v string) { + o.CompressedMessage = &v +} + +// GetHeaders returns the Headers field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetHeaders() map[string]interface{} { + if o == nil || o.Headers == nil { + var ret map[string]interface{} + return ret + } + return o.Headers +} + +// GetHeadersOk returns a tuple with the Headers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetHeadersOk() (*map[string]interface{}, bool) { + if o == nil || o.Headers == nil { + return nil, false + } + return &o.Headers, true +} + +// HasHeaders returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasHeaders() bool { + return o != nil && o.Headers != nil +} + +// SetHeaders gets a reference to the given map[string]interface{} and assigns it to the Headers field. +func (o *SyntheticsTestResultResponseInfo) SetHeaders(v map[string]interface{}) { + o.Headers = v +} + +// GetHealthcheck returns the Healthcheck field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetHealthcheck() SyntheticsTestResultHealthCheck { + if o == nil || o.Healthcheck == nil { + var ret SyntheticsTestResultHealthCheck + return ret + } + return *o.Healthcheck +} + +// GetHealthcheckOk returns a tuple with the Healthcheck field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetHealthcheckOk() (*SyntheticsTestResultHealthCheck, bool) { + if o == nil || o.Healthcheck == nil { + return nil, false + } + return o.Healthcheck, true +} + +// HasHealthcheck returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasHealthcheck() bool { + return o != nil && o.Healthcheck != nil +} + +// SetHealthcheck gets a reference to the given SyntheticsTestResultHealthCheck and assigns it to the Healthcheck field. +func (o *SyntheticsTestResultResponseInfo) SetHealthcheck(v SyntheticsTestResultHealthCheck) { + o.Healthcheck = &v +} + +// GetHttpVersion returns the HttpVersion field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetHttpVersion() string { + if o == nil || o.HttpVersion == nil { + var ret string + return ret + } + return *o.HttpVersion +} + +// GetHttpVersionOk returns a tuple with the HttpVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetHttpVersionOk() (*string, bool) { + if o == nil || o.HttpVersion == nil { + return nil, false + } + return o.HttpVersion, true +} + +// HasHttpVersion returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasHttpVersion() bool { + return o != nil && o.HttpVersion != nil +} + +// SetHttpVersion gets a reference to the given string and assigns it to the HttpVersion field. +func (o *SyntheticsTestResultResponseInfo) SetHttpVersion(v string) { + o.HttpVersion = &v +} + +// GetIsBodyTruncated returns the IsBodyTruncated field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetIsBodyTruncated() bool { + if o == nil || o.IsBodyTruncated == nil { + var ret bool + return ret + } + return *o.IsBodyTruncated +} + +// GetIsBodyTruncatedOk returns a tuple with the IsBodyTruncated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetIsBodyTruncatedOk() (*bool, bool) { + if o == nil || o.IsBodyTruncated == nil { + return nil, false + } + return o.IsBodyTruncated, true +} + +// HasIsBodyTruncated returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasIsBodyTruncated() bool { + return o != nil && o.IsBodyTruncated != nil +} + +// SetIsBodyTruncated gets a reference to the given bool and assigns it to the IsBodyTruncated field. +func (o *SyntheticsTestResultResponseInfo) SetIsBodyTruncated(v bool) { + o.IsBodyTruncated = &v +} + +// GetIsMessageTruncated returns the IsMessageTruncated field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetIsMessageTruncated() bool { + if o == nil || o.IsMessageTruncated == nil { + var ret bool + return ret + } + return *o.IsMessageTruncated +} + +// GetIsMessageTruncatedOk returns a tuple with the IsMessageTruncated field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetIsMessageTruncatedOk() (*bool, bool) { + if o == nil || o.IsMessageTruncated == nil { + return nil, false + } + return o.IsMessageTruncated, true +} + +// HasIsMessageTruncated returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasIsMessageTruncated() bool { + return o != nil && o.IsMessageTruncated != nil +} + +// SetIsMessageTruncated gets a reference to the given bool and assigns it to the IsMessageTruncated field. +func (o *SyntheticsTestResultResponseInfo) SetIsMessageTruncated(v bool) { + o.IsMessageTruncated = &v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SyntheticsTestResultResponseInfo) SetMessage(v string) { + o.Message = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetMetadata() map[string]string { + if o == nil || o.Metadata == nil { + var ret map[string]string + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetMetadataOk() (*map[string]string, bool) { + if o == nil || o.Metadata == nil { + return nil, false + } + return &o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasMetadata() bool { + return o != nil && o.Metadata != nil +} + +// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field. +func (o *SyntheticsTestResultResponseInfo) SetMetadata(v map[string]string) { + o.Metadata = v +} + +// GetRecords returns the Records field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetRecords() []SyntheticsTestResultDnsRecord { + if o == nil || o.Records == nil { + var ret []SyntheticsTestResultDnsRecord + return ret + } + return o.Records +} + +// GetRecordsOk returns a tuple with the Records field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetRecordsOk() (*[]SyntheticsTestResultDnsRecord, bool) { + if o == nil || o.Records == nil { + return nil, false + } + return &o.Records, true +} + +// HasRecords returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasRecords() bool { + return o != nil && o.Records != nil +} + +// SetRecords gets a reference to the given []SyntheticsTestResultDnsRecord and assigns it to the Records field. +func (o *SyntheticsTestResultResponseInfo) SetRecords(v []SyntheticsTestResultDnsRecord) { + o.Records = v +} + +// GetRedirects returns the Redirects field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetRedirects() []SyntheticsTestResultRedirect { + if o == nil || o.Redirects == nil { + var ret []SyntheticsTestResultRedirect + return ret + } + return o.Redirects +} + +// GetRedirectsOk returns a tuple with the Redirects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetRedirectsOk() (*[]SyntheticsTestResultRedirect, bool) { + if o == nil || o.Redirects == nil { + return nil, false + } + return &o.Redirects, true +} + +// HasRedirects returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasRedirects() bool { + return o != nil && o.Redirects != nil +} + +// SetRedirects gets a reference to the given []SyntheticsTestResultRedirect and assigns it to the Redirects field. +func (o *SyntheticsTestResultResponseInfo) SetRedirects(v []SyntheticsTestResultRedirect) { + o.Redirects = v +} + +// GetStatusCode returns the StatusCode field value if set, zero value otherwise. +func (o *SyntheticsTestResultResponseInfo) GetStatusCode() int64 { + if o == nil || o.StatusCode == nil { + var ret int64 + return ret + } + return *o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultResponseInfo) GetStatusCodeOk() (*int64, bool) { + if o == nil || o.StatusCode == nil { + return nil, false + } + return o.StatusCode, true +} + +// HasStatusCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultResponseInfo) HasStatusCode() bool { + return o != nil && o.StatusCode != nil +} + +// SetStatusCode gets a reference to the given int64 and assigns it to the StatusCode field. +func (o *SyntheticsTestResultResponseInfo) SetStatusCode(v int64) { + o.StatusCode = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultResponseInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Body != nil { + toSerialize["body"] = o.Body + } + if o.BodyCompressed != nil { + toSerialize["body_compressed"] = o.BodyCompressed + } + if o.BodyHashes != nil { + toSerialize["body_hashes"] = o.BodyHashes + } + if o.BodySize != nil { + toSerialize["body_size"] = o.BodySize + } + if o.CacheHeaders != nil { + toSerialize["cache_headers"] = o.CacheHeaders + } + if o.Cdn != nil { + toSerialize["cdn"] = o.Cdn + } + if o.Close != nil { + toSerialize["close"] = o.Close + } + if o.CompressedMessage != nil { + toSerialize["compressed_message"] = o.CompressedMessage + } + if o.Headers != nil { + toSerialize["headers"] = o.Headers + } + if o.Healthcheck != nil { + toSerialize["healthcheck"] = o.Healthcheck + } + if o.HttpVersion != nil { + toSerialize["http_version"] = o.HttpVersion + } + if o.IsBodyTruncated != nil { + toSerialize["is_body_truncated"] = o.IsBodyTruncated + } + if o.IsMessageTruncated != nil { + toSerialize["is_message_truncated"] = o.IsMessageTruncated + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Metadata != nil { + toSerialize["metadata"] = o.Metadata + } + if o.Records != nil { + toSerialize["records"] = o.Records + } + if o.Redirects != nil { + toSerialize["redirects"] = o.Redirects + } + if o.StatusCode != nil { + toSerialize["status_code"] = o.StatusCode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultResponseInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Body *string `json:"body,omitempty"` + BodyCompressed *string `json:"body_compressed,omitempty"` + BodyHashes *string `json:"body_hashes,omitempty"` + BodySize *int64 `json:"body_size,omitempty"` + CacheHeaders map[string]string `json:"cache_headers,omitempty"` + Cdn *SyntheticsTestResultCdnProviderInfo `json:"cdn,omitempty"` + Close *SyntheticsTestResultWebSocketClose `json:"close,omitempty"` + CompressedMessage *string `json:"compressed_message,omitempty"` + Headers map[string]interface{} `json:"headers,omitempty"` + Healthcheck *SyntheticsTestResultHealthCheck `json:"healthcheck,omitempty"` + HttpVersion *string `json:"http_version,omitempty"` + IsBodyTruncated *bool `json:"is_body_truncated,omitempty"` + IsMessageTruncated *bool `json:"is_message_truncated,omitempty"` + Message *string `json:"message,omitempty"` + Metadata map[string]string `json:"metadata,omitempty"` + Records []SyntheticsTestResultDnsRecord `json:"records,omitempty"` + Redirects []SyntheticsTestResultRedirect `json:"redirects,omitempty"` + StatusCode *int64 `json:"status_code,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"body", "body_compressed", "body_hashes", "body_size", "cache_headers", "cdn", "close", "compressed_message", "headers", "healthcheck", "http_version", "is_body_truncated", "is_message_truncated", "message", "metadata", "records", "redirects", "status_code"}) + } else { + return err + } + + hasInvalidField := false + o.Body = all.Body + o.BodyCompressed = all.BodyCompressed + o.BodyHashes = all.BodyHashes + o.BodySize = all.BodySize + o.CacheHeaders = all.CacheHeaders + if all.Cdn != nil && all.Cdn.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Cdn = all.Cdn + if all.Close != nil && all.Close.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Close = all.Close + o.CompressedMessage = all.CompressedMessage + o.Headers = all.Headers + if all.Healthcheck != nil && all.Healthcheck.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Healthcheck = all.Healthcheck + o.HttpVersion = all.HttpVersion + o.IsBodyTruncated = all.IsBodyTruncated + o.IsMessageTruncated = all.IsMessageTruncated + o.Message = all.Message + o.Metadata = all.Metadata + o.Records = all.Records + o.Redirects = all.Redirects + o.StatusCode = all.StatusCode + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_router.go b/api/datadogV2/model_synthetics_test_result_router.go new file mode 100644 index 00000000000..1e466fd59ec --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_router.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRouter A router along the traceroute path. +type SyntheticsTestResultRouter struct { + // IP address of the router. + Ip *string `json:"ip,omitempty"` + // Resolved hostname of the router. + ResolvedHost *string `json:"resolved_host,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRouter instantiates a new SyntheticsTestResultRouter object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRouter() *SyntheticsTestResultRouter { + this := SyntheticsTestResultRouter{} + return &this +} + +// NewSyntheticsTestResultRouterWithDefaults instantiates a new SyntheticsTestResultRouter object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRouterWithDefaults() *SyntheticsTestResultRouter { + this := SyntheticsTestResultRouter{} + return &this +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *SyntheticsTestResultRouter) GetIp() string { + if o == nil || o.Ip == nil { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRouter) GetIpOk() (*string, bool) { + if o == nil || o.Ip == nil { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *SyntheticsTestResultRouter) HasIp() bool { + return o != nil && o.Ip != nil +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *SyntheticsTestResultRouter) SetIp(v string) { + o.Ip = &v +} + +// GetResolvedHost returns the ResolvedHost field value if set, zero value otherwise. +func (o *SyntheticsTestResultRouter) GetResolvedHost() string { + if o == nil || o.ResolvedHost == nil { + var ret string + return ret + } + return *o.ResolvedHost +} + +// GetResolvedHostOk returns a tuple with the ResolvedHost field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRouter) GetResolvedHostOk() (*string, bool) { + if o == nil || o.ResolvedHost == nil { + return nil, false + } + return o.ResolvedHost, true +} + +// HasResolvedHost returns a boolean if a field has been set. +func (o *SyntheticsTestResultRouter) HasResolvedHost() bool { + return o != nil && o.ResolvedHost != nil +} + +// SetResolvedHost gets a reference to the given string and assigns it to the ResolvedHost field. +func (o *SyntheticsTestResultRouter) SetResolvedHost(v string) { + o.ResolvedHost = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRouter) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Ip != nil { + toSerialize["ip"] = o.Ip + } + if o.ResolvedHost != nil { + toSerialize["resolved_host"] = o.ResolvedHost + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRouter) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Ip *string `json:"ip,omitempty"` + ResolvedHost *string `json:"resolved_host,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"ip", "resolved_host"}) + } else { + return err + } + o.Ip = all.Ip + o.ResolvedHost = all.ResolvedHost + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_rum_context.go b/api/datadogV2/model_synthetics_test_result_rum_context.go new file mode 100644 index 00000000000..70957191eb7 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_rum_context.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRumContext RUM application context associated with a step or sub-test. +type SyntheticsTestResultRumContext struct { + // RUM application identifier. + ApplicationId *string `json:"application_id,omitempty"` + // RUM session identifier. + SessionId *string `json:"session_id,omitempty"` + // RUM view identifier. + ViewId *string `json:"view_id,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultRumContext instantiates a new SyntheticsTestResultRumContext object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultRumContext() *SyntheticsTestResultRumContext { + this := SyntheticsTestResultRumContext{} + return &this +} + +// NewSyntheticsTestResultRumContextWithDefaults instantiates a new SyntheticsTestResultRumContext object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultRumContextWithDefaults() *SyntheticsTestResultRumContext { + this := SyntheticsTestResultRumContext{} + return &this +} + +// GetApplicationId returns the ApplicationId field value if set, zero value otherwise. +func (o *SyntheticsTestResultRumContext) GetApplicationId() string { + if o == nil || o.ApplicationId == nil { + var ret string + return ret + } + return *o.ApplicationId +} + +// GetApplicationIdOk returns a tuple with the ApplicationId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRumContext) GetApplicationIdOk() (*string, bool) { + if o == nil || o.ApplicationId == nil { + return nil, false + } + return o.ApplicationId, true +} + +// HasApplicationId returns a boolean if a field has been set. +func (o *SyntheticsTestResultRumContext) HasApplicationId() bool { + return o != nil && o.ApplicationId != nil +} + +// SetApplicationId gets a reference to the given string and assigns it to the ApplicationId field. +func (o *SyntheticsTestResultRumContext) SetApplicationId(v string) { + o.ApplicationId = &v +} + +// GetSessionId returns the SessionId field value if set, zero value otherwise. +func (o *SyntheticsTestResultRumContext) GetSessionId() string { + if o == nil || o.SessionId == nil { + var ret string + return ret + } + return *o.SessionId +} + +// GetSessionIdOk returns a tuple with the SessionId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRumContext) GetSessionIdOk() (*string, bool) { + if o == nil || o.SessionId == nil { + return nil, false + } + return o.SessionId, true +} + +// HasSessionId returns a boolean if a field has been set. +func (o *SyntheticsTestResultRumContext) HasSessionId() bool { + return o != nil && o.SessionId != nil +} + +// SetSessionId gets a reference to the given string and assigns it to the SessionId field. +func (o *SyntheticsTestResultRumContext) SetSessionId(v string) { + o.SessionId = &v +} + +// GetViewId returns the ViewId field value if set, zero value otherwise. +func (o *SyntheticsTestResultRumContext) GetViewId() string { + if o == nil || o.ViewId == nil { + var ret string + return ret + } + return *o.ViewId +} + +// GetViewIdOk returns a tuple with the ViewId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultRumContext) GetViewIdOk() (*string, bool) { + if o == nil || o.ViewId == nil { + return nil, false + } + return o.ViewId, true +} + +// HasViewId returns a boolean if a field has been set. +func (o *SyntheticsTestResultRumContext) HasViewId() bool { + return o != nil && o.ViewId != nil +} + +// SetViewId gets a reference to the given string and assigns it to the ViewId field. +func (o *SyntheticsTestResultRumContext) SetViewId(v string) { + o.ViewId = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultRumContext) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ApplicationId != nil { + toSerialize["application_id"] = o.ApplicationId + } + if o.SessionId != nil { + toSerialize["session_id"] = o.SessionId + } + if o.ViewId != nil { + toSerialize["view_id"] = o.ViewId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultRumContext) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ApplicationId *string `json:"application_id,omitempty"` + SessionId *string `json:"session_id,omitempty"` + ViewId *string `json:"view_id,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"application_id", "session_id", "view_id"}) + } else { + return err + } + o.ApplicationId = all.ApplicationId + o.SessionId = all.SessionId + o.ViewId = all.ViewId + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_run_type.go b/api/datadogV2/model_synthetics_test_result_run_type.go new file mode 100644 index 00000000000..6421253d5a5 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_run_type.go @@ -0,0 +1,70 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultRunType The type of run for a Synthetic test result. +type SyntheticsTestResultRunType string + +// List of SyntheticsTestResultRunType. +const ( + SYNTHETICSTESTRESULTRUNTYPE_SCHEDULED SyntheticsTestResultRunType = "scheduled" + SYNTHETICSTESTRESULTRUNTYPE_FAST SyntheticsTestResultRunType = "fast" + SYNTHETICSTESTRESULTRUNTYPE_CI SyntheticsTestResultRunType = "ci" + SYNTHETICSTESTRESULTRUNTYPE_TRIGGERED SyntheticsTestResultRunType = "triggered" +) + +var allowedSyntheticsTestResultRunTypeEnumValues = []SyntheticsTestResultRunType{ + SYNTHETICSTESTRESULTRUNTYPE_SCHEDULED, + SYNTHETICSTESTRESULTRUNTYPE_FAST, + SYNTHETICSTESTRESULTRUNTYPE_CI, + SYNTHETICSTESTRESULTRUNTYPE_TRIGGERED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestResultRunType) GetAllowedValues() []SyntheticsTestResultRunType { + return allowedSyntheticsTestResultRunTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestResultRunType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestResultRunType(value) + return nil +} + +// NewSyntheticsTestResultRunTypeFromValue returns a pointer to a valid SyntheticsTestResultRunType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestResultRunTypeFromValue(v string) (*SyntheticsTestResultRunType, error) { + ev := SyntheticsTestResultRunType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestResultRunType: valid values are %v", v, allowedSyntheticsTestResultRunTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestResultRunType) IsValid() bool { + for _, existing := range allowedSyntheticsTestResultRunTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestResultRunType value. +func (v SyntheticsTestResultRunType) Ptr() *SyntheticsTestResultRunType { + return &v +} diff --git a/api/datadogV2/model_synthetics_test_result_status.go b/api/datadogV2/model_synthetics_test_result_status.go new file mode 100644 index 00000000000..ac981270621 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_status.go @@ -0,0 +1,68 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultStatus Status of a Synthetic test result. +type SyntheticsTestResultStatus string + +// List of SyntheticsTestResultStatus. +const ( + SYNTHETICSTESTRESULTSTATUS_PASSED SyntheticsTestResultStatus = "passed" + SYNTHETICSTESTRESULTSTATUS_FAILED SyntheticsTestResultStatus = "failed" + SYNTHETICSTESTRESULTSTATUS_NO_DATA SyntheticsTestResultStatus = "no_data" +) + +var allowedSyntheticsTestResultStatusEnumValues = []SyntheticsTestResultStatus{ + SYNTHETICSTESTRESULTSTATUS_PASSED, + SYNTHETICSTESTRESULTSTATUS_FAILED, + SYNTHETICSTESTRESULTSTATUS_NO_DATA, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestResultStatus) GetAllowedValues() []SyntheticsTestResultStatus { + return allowedSyntheticsTestResultStatusEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestResultStatus) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestResultStatus(value) + return nil +} + +// NewSyntheticsTestResultStatusFromValue returns a pointer to a valid SyntheticsTestResultStatus +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestResultStatusFromValue(v string) (*SyntheticsTestResultStatus, error) { + ev := SyntheticsTestResultStatus(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestResultStatus: valid values are %v", v, allowedSyntheticsTestResultStatusEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestResultStatus) IsValid() bool { + for _, existing := range allowedSyntheticsTestResultStatusEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestResultStatus value. +func (v SyntheticsTestResultStatus) Ptr() *SyntheticsTestResultStatus { + return &v +} diff --git a/api/datadogV2/model_synthetics_test_result_step.go b/api/datadogV2/model_synthetics_test_result_step.go new file mode 100644 index 00000000000..87dbbe53e86 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_step.go @@ -0,0 +1,1614 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultStep A step result from a browser, mobile, or multistep API test. +type SyntheticsTestResultStep struct { + // Whether the test continues when this step fails. + AllowFailure *bool `json:"allow_failure,omitempty"` + // Inner API test definition for browser `runApiTest` steps. + ApiTest map[string]interface{} `json:"api_test,omitempty"` + // Assertion result for a browser or mobile step. + AssertionResult *SyntheticsTestResultStepAssertionResult `json:"assertion_result,omitempty"` + // Assertion results produced by the step. + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` + // URLs of requests blocked during the step. + BlockedRequestsUrls []string `json:"blocked_requests_urls,omitempty"` + // Bounding box of an element on the page. + Bounds *SyntheticsTestResultBounds `json:"bounds,omitempty"` + // Browser errors captured during the step. + BrowserErrors []SyntheticsTestResultBrowserError `json:"browser_errors,omitempty"` + // Storage bucket keys for artifacts produced during a step or test. + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + // CDN resources encountered during the step. + CdnResources []SyntheticsTestResultCdnResource `json:"cdn_resources,omitempty"` + // Click type performed in a browser step. + ClickType *string `json:"click_type,omitempty"` + // Compressed JSON descriptor for the step (internal format). + CompressedJsonDescriptor *string `json:"compressed_json_descriptor,omitempty"` + // Request configuration executed by this step (API test steps). + Config map[string]interface{} `json:"config,omitempty"` + // Human-readable description of the step. + Description *string `json:"description,omitempty"` + // Duration of the step in milliseconds. + Duration *float64 `json:"duration,omitempty"` + // Description of the element interacted with by the step. + ElementDescription *string `json:"element_description,omitempty"` + // Element locator updates produced during a step. + ElementUpdates *SyntheticsTestResultStepElementUpdates `json:"element_updates,omitempty"` + // A variable used or extracted during a test. + ExtractedValue *SyntheticsTestResultVariable `json:"extracted_value,omitempty"` + // Details about the failure of a Synthetic test. + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` + // HTTP results produced by an MCP step. + HttpResults []SyntheticsTestResultAssertionResult `json:"http_results,omitempty"` + // Identifier of the step. + Id *string `json:"id,omitempty"` + // Whether this step is critical for the test outcome. + IsCritical *bool `json:"is_critical,omitempty"` + // Whether the step uses a custom JavaScript assertion. + JavascriptCustomAssertionCode *bool `json:"javascript_custom_assertion_code,omitempty"` + // Time taken to locate the element in milliseconds. + LocateElementDuration *float64 `json:"locate_element_duration,omitempty"` + // Name of the step. + Name *string `json:"name,omitempty"` + // Details of the outgoing request made during the test execution. + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + // Details of the response received during the test execution. + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + // Retry results for the step. + Retries []SyntheticsTestResultStep `json:"retries,omitempty"` + // Number of times this step was retried. + RetryCount *int64 `json:"retry_count,omitempty"` + // RUM application context associated with a step or sub-test. + RumContext *SyntheticsTestResultRumContext `json:"rum_context,omitempty"` + // Unix timestamp (ms) of when the step started. + StartedAt *int64 `json:"started_at,omitempty"` + // Status of the step (for example, `passed`, `failed`). + Status *string `json:"status,omitempty"` + // Information about a sub-step in a nested test execution. + SubStep *SyntheticsTestResultSubStep `json:"sub_step,omitempty"` + // Information about a sub-test played from a parent browser test. + SubTest *SyntheticsTestResultSubTest `json:"sub_test,omitempty"` + // Subtype of the step. + Subtype *string `json:"subtype,omitempty"` + // Browser tabs involved in the step. + Tabs []SyntheticsTestResultTab `json:"tabs,omitempty"` + // Timing breakdown of the step execution. + Timings map[string]interface{} `json:"timings,omitempty"` + // Whether the step was executed through a Synthetics tunnel. + Tunnel *bool `json:"tunnel,omitempty"` + // Type of the step (for example, `click`, `assertElementContent`, `runApiTest`). + Type *string `json:"type,omitempty"` + // URL associated with the step (for navigation steps). + Url *string `json:"url,omitempty"` + // Step value. Its type depends on the step type. + Value interface{} `json:"value,omitempty"` + // Variables captured during a test step. + Variables *SyntheticsTestResultVariables `json:"variables,omitempty"` + // Web vitals metrics captured during the step. + VitalsMetrics []SyntheticsTestResultVitalsMetrics `json:"vitals_metrics,omitempty"` + // Warnings emitted during the step. + Warnings []SyntheticsTestResultWarning `json:"warnings,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultStep instantiates a new SyntheticsTestResultStep object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultStep() *SyntheticsTestResultStep { + this := SyntheticsTestResultStep{} + return &this +} + +// NewSyntheticsTestResultStepWithDefaults instantiates a new SyntheticsTestResultStep object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultStepWithDefaults() *SyntheticsTestResultStep { + this := SyntheticsTestResultStep{} + return &this +} + +// GetAllowFailure returns the AllowFailure field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetAllowFailure() bool { + if o == nil || o.AllowFailure == nil { + var ret bool + return ret + } + return *o.AllowFailure +} + +// GetAllowFailureOk returns a tuple with the AllowFailure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetAllowFailureOk() (*bool, bool) { + if o == nil || o.AllowFailure == nil { + return nil, false + } + return o.AllowFailure, true +} + +// HasAllowFailure returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasAllowFailure() bool { + return o != nil && o.AllowFailure != nil +} + +// SetAllowFailure gets a reference to the given bool and assigns it to the AllowFailure field. +func (o *SyntheticsTestResultStep) SetAllowFailure(v bool) { + o.AllowFailure = &v +} + +// GetApiTest returns the ApiTest field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetApiTest() map[string]interface{} { + if o == nil || o.ApiTest == nil { + var ret map[string]interface{} + return ret + } + return o.ApiTest +} + +// GetApiTestOk returns a tuple with the ApiTest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetApiTestOk() (*map[string]interface{}, bool) { + if o == nil || o.ApiTest == nil { + return nil, false + } + return &o.ApiTest, true +} + +// HasApiTest returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasApiTest() bool { + return o != nil && o.ApiTest != nil +} + +// SetApiTest gets a reference to the given map[string]interface{} and assigns it to the ApiTest field. +func (o *SyntheticsTestResultStep) SetApiTest(v map[string]interface{}) { + o.ApiTest = v +} + +// GetAssertionResult returns the AssertionResult field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetAssertionResult() SyntheticsTestResultStepAssertionResult { + if o == nil || o.AssertionResult == nil { + var ret SyntheticsTestResultStepAssertionResult + return ret + } + return *o.AssertionResult +} + +// GetAssertionResultOk returns a tuple with the AssertionResult field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetAssertionResultOk() (*SyntheticsTestResultStepAssertionResult, bool) { + if o == nil || o.AssertionResult == nil { + return nil, false + } + return o.AssertionResult, true +} + +// HasAssertionResult returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasAssertionResult() bool { + return o != nil && o.AssertionResult != nil +} + +// SetAssertionResult gets a reference to the given SyntheticsTestResultStepAssertionResult and assigns it to the AssertionResult field. +func (o *SyntheticsTestResultStep) SetAssertionResult(v SyntheticsTestResultStepAssertionResult) { + o.AssertionResult = &v +} + +// GetAssertions returns the Assertions field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetAssertions() []SyntheticsTestResultAssertionResult { + if o == nil || o.Assertions == nil { + var ret []SyntheticsTestResultAssertionResult + return ret + } + return o.Assertions +} + +// GetAssertionsOk returns a tuple with the Assertions field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetAssertionsOk() (*[]SyntheticsTestResultAssertionResult, bool) { + if o == nil || o.Assertions == nil { + return nil, false + } + return &o.Assertions, true +} + +// HasAssertions returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasAssertions() bool { + return o != nil && o.Assertions != nil +} + +// SetAssertions gets a reference to the given []SyntheticsTestResultAssertionResult and assigns it to the Assertions field. +func (o *SyntheticsTestResultStep) SetAssertions(v []SyntheticsTestResultAssertionResult) { + o.Assertions = v +} + +// GetBlockedRequestsUrls returns the BlockedRequestsUrls field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetBlockedRequestsUrls() []string { + if o == nil || o.BlockedRequestsUrls == nil { + var ret []string + return ret + } + return o.BlockedRequestsUrls +} + +// GetBlockedRequestsUrlsOk returns a tuple with the BlockedRequestsUrls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetBlockedRequestsUrlsOk() (*[]string, bool) { + if o == nil || o.BlockedRequestsUrls == nil { + return nil, false + } + return &o.BlockedRequestsUrls, true +} + +// HasBlockedRequestsUrls returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasBlockedRequestsUrls() bool { + return o != nil && o.BlockedRequestsUrls != nil +} + +// SetBlockedRequestsUrls gets a reference to the given []string and assigns it to the BlockedRequestsUrls field. +func (o *SyntheticsTestResultStep) SetBlockedRequestsUrls(v []string) { + o.BlockedRequestsUrls = v +} + +// GetBounds returns the Bounds field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetBounds() SyntheticsTestResultBounds { + if o == nil || o.Bounds == nil { + var ret SyntheticsTestResultBounds + return ret + } + return *o.Bounds +} + +// GetBoundsOk returns a tuple with the Bounds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetBoundsOk() (*SyntheticsTestResultBounds, bool) { + if o == nil || o.Bounds == nil { + return nil, false + } + return o.Bounds, true +} + +// HasBounds returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasBounds() bool { + return o != nil && o.Bounds != nil +} + +// SetBounds gets a reference to the given SyntheticsTestResultBounds and assigns it to the Bounds field. +func (o *SyntheticsTestResultStep) SetBounds(v SyntheticsTestResultBounds) { + o.Bounds = &v +} + +// GetBrowserErrors returns the BrowserErrors field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetBrowserErrors() []SyntheticsTestResultBrowserError { + if o == nil || o.BrowserErrors == nil { + var ret []SyntheticsTestResultBrowserError + return ret + } + return o.BrowserErrors +} + +// GetBrowserErrorsOk returns a tuple with the BrowserErrors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetBrowserErrorsOk() (*[]SyntheticsTestResultBrowserError, bool) { + if o == nil || o.BrowserErrors == nil { + return nil, false + } + return &o.BrowserErrors, true +} + +// HasBrowserErrors returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasBrowserErrors() bool { + return o != nil && o.BrowserErrors != nil +} + +// SetBrowserErrors gets a reference to the given []SyntheticsTestResultBrowserError and assigns it to the BrowserErrors field. +func (o *SyntheticsTestResultStep) SetBrowserErrors(v []SyntheticsTestResultBrowserError) { + o.BrowserErrors = v +} + +// GetBucketKeys returns the BucketKeys field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetBucketKeys() SyntheticsTestResultBucketKeys { + if o == nil || o.BucketKeys == nil { + var ret SyntheticsTestResultBucketKeys + return ret + } + return *o.BucketKeys +} + +// GetBucketKeysOk returns a tuple with the BucketKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetBucketKeysOk() (*SyntheticsTestResultBucketKeys, bool) { + if o == nil || o.BucketKeys == nil { + return nil, false + } + return o.BucketKeys, true +} + +// HasBucketKeys returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasBucketKeys() bool { + return o != nil && o.BucketKeys != nil +} + +// SetBucketKeys gets a reference to the given SyntheticsTestResultBucketKeys and assigns it to the BucketKeys field. +func (o *SyntheticsTestResultStep) SetBucketKeys(v SyntheticsTestResultBucketKeys) { + o.BucketKeys = &v +} + +// GetCdnResources returns the CdnResources field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetCdnResources() []SyntheticsTestResultCdnResource { + if o == nil || o.CdnResources == nil { + var ret []SyntheticsTestResultCdnResource + return ret + } + return o.CdnResources +} + +// GetCdnResourcesOk returns a tuple with the CdnResources field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetCdnResourcesOk() (*[]SyntheticsTestResultCdnResource, bool) { + if o == nil || o.CdnResources == nil { + return nil, false + } + return &o.CdnResources, true +} + +// HasCdnResources returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasCdnResources() bool { + return o != nil && o.CdnResources != nil +} + +// SetCdnResources gets a reference to the given []SyntheticsTestResultCdnResource and assigns it to the CdnResources field. +func (o *SyntheticsTestResultStep) SetCdnResources(v []SyntheticsTestResultCdnResource) { + o.CdnResources = v +} + +// GetClickType returns the ClickType field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetClickType() string { + if o == nil || o.ClickType == nil { + var ret string + return ret + } + return *o.ClickType +} + +// GetClickTypeOk returns a tuple with the ClickType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetClickTypeOk() (*string, bool) { + if o == nil || o.ClickType == nil { + return nil, false + } + return o.ClickType, true +} + +// HasClickType returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasClickType() bool { + return o != nil && o.ClickType != nil +} + +// SetClickType gets a reference to the given string and assigns it to the ClickType field. +func (o *SyntheticsTestResultStep) SetClickType(v string) { + o.ClickType = &v +} + +// GetCompressedJsonDescriptor returns the CompressedJsonDescriptor field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetCompressedJsonDescriptor() string { + if o == nil || o.CompressedJsonDescriptor == nil { + var ret string + return ret + } + return *o.CompressedJsonDescriptor +} + +// GetCompressedJsonDescriptorOk returns a tuple with the CompressedJsonDescriptor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetCompressedJsonDescriptorOk() (*string, bool) { + if o == nil || o.CompressedJsonDescriptor == nil { + return nil, false + } + return o.CompressedJsonDescriptor, true +} + +// HasCompressedJsonDescriptor returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasCompressedJsonDescriptor() bool { + return o != nil && o.CompressedJsonDescriptor != nil +} + +// SetCompressedJsonDescriptor gets a reference to the given string and assigns it to the CompressedJsonDescriptor field. +func (o *SyntheticsTestResultStep) SetCompressedJsonDescriptor(v string) { + o.CompressedJsonDescriptor = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetConfig() map[string]interface{} { + if o == nil || o.Config == nil { + var ret map[string]interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetConfigOk() (*map[string]interface{}, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasConfig() bool { + return o != nil && o.Config != nil +} + +// SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. +func (o *SyntheticsTestResultStep) SetConfig(v map[string]interface{}) { + o.Config = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SyntheticsTestResultStep) SetDescription(v string) { + o.Description = &v +} + +// GetDuration returns the Duration field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetDuration() float64 { + if o == nil || o.Duration == nil { + var ret float64 + return ret + } + return *o.Duration +} + +// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetDurationOk() (*float64, bool) { + if o == nil || o.Duration == nil { + return nil, false + } + return o.Duration, true +} + +// HasDuration returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasDuration() bool { + return o != nil && o.Duration != nil +} + +// SetDuration gets a reference to the given float64 and assigns it to the Duration field. +func (o *SyntheticsTestResultStep) SetDuration(v float64) { + o.Duration = &v +} + +// GetElementDescription returns the ElementDescription field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetElementDescription() string { + if o == nil || o.ElementDescription == nil { + var ret string + return ret + } + return *o.ElementDescription +} + +// GetElementDescriptionOk returns a tuple with the ElementDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetElementDescriptionOk() (*string, bool) { + if o == nil || o.ElementDescription == nil { + return nil, false + } + return o.ElementDescription, true +} + +// HasElementDescription returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasElementDescription() bool { + return o != nil && o.ElementDescription != nil +} + +// SetElementDescription gets a reference to the given string and assigns it to the ElementDescription field. +func (o *SyntheticsTestResultStep) SetElementDescription(v string) { + o.ElementDescription = &v +} + +// GetElementUpdates returns the ElementUpdates field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetElementUpdates() SyntheticsTestResultStepElementUpdates { + if o == nil || o.ElementUpdates == nil { + var ret SyntheticsTestResultStepElementUpdates + return ret + } + return *o.ElementUpdates +} + +// GetElementUpdatesOk returns a tuple with the ElementUpdates field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetElementUpdatesOk() (*SyntheticsTestResultStepElementUpdates, bool) { + if o == nil || o.ElementUpdates == nil { + return nil, false + } + return o.ElementUpdates, true +} + +// HasElementUpdates returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasElementUpdates() bool { + return o != nil && o.ElementUpdates != nil +} + +// SetElementUpdates gets a reference to the given SyntheticsTestResultStepElementUpdates and assigns it to the ElementUpdates field. +func (o *SyntheticsTestResultStep) SetElementUpdates(v SyntheticsTestResultStepElementUpdates) { + o.ElementUpdates = &v +} + +// GetExtractedValue returns the ExtractedValue field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetExtractedValue() SyntheticsTestResultVariable { + if o == nil || o.ExtractedValue == nil { + var ret SyntheticsTestResultVariable + return ret + } + return *o.ExtractedValue +} + +// GetExtractedValueOk returns a tuple with the ExtractedValue field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetExtractedValueOk() (*SyntheticsTestResultVariable, bool) { + if o == nil || o.ExtractedValue == nil { + return nil, false + } + return o.ExtractedValue, true +} + +// HasExtractedValue returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasExtractedValue() bool { + return o != nil && o.ExtractedValue != nil +} + +// SetExtractedValue gets a reference to the given SyntheticsTestResultVariable and assigns it to the ExtractedValue field. +func (o *SyntheticsTestResultStep) SetExtractedValue(v SyntheticsTestResultVariable) { + o.ExtractedValue = &v +} + +// GetFailure returns the Failure field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetFailure() SyntheticsTestResultFailure { + if o == nil || o.Failure == nil { + var ret SyntheticsTestResultFailure + return ret + } + return *o.Failure +} + +// GetFailureOk returns a tuple with the Failure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetFailureOk() (*SyntheticsTestResultFailure, bool) { + if o == nil || o.Failure == nil { + return nil, false + } + return o.Failure, true +} + +// HasFailure returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasFailure() bool { + return o != nil && o.Failure != nil +} + +// SetFailure gets a reference to the given SyntheticsTestResultFailure and assigns it to the Failure field. +func (o *SyntheticsTestResultStep) SetFailure(v SyntheticsTestResultFailure) { + o.Failure = &v +} + +// GetHttpResults returns the HttpResults field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetHttpResults() []SyntheticsTestResultAssertionResult { + if o == nil || o.HttpResults == nil { + var ret []SyntheticsTestResultAssertionResult + return ret + } + return o.HttpResults +} + +// GetHttpResultsOk returns a tuple with the HttpResults field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetHttpResultsOk() (*[]SyntheticsTestResultAssertionResult, bool) { + if o == nil || o.HttpResults == nil { + return nil, false + } + return &o.HttpResults, true +} + +// HasHttpResults returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasHttpResults() bool { + return o != nil && o.HttpResults != nil +} + +// SetHttpResults gets a reference to the given []SyntheticsTestResultAssertionResult and assigns it to the HttpResults field. +func (o *SyntheticsTestResultStep) SetHttpResults(v []SyntheticsTestResultAssertionResult) { + o.HttpResults = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultStep) SetId(v string) { + o.Id = &v +} + +// GetIsCritical returns the IsCritical field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetIsCritical() bool { + if o == nil || o.IsCritical == nil { + var ret bool + return ret + } + return *o.IsCritical +} + +// GetIsCriticalOk returns a tuple with the IsCritical field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetIsCriticalOk() (*bool, bool) { + if o == nil || o.IsCritical == nil { + return nil, false + } + return o.IsCritical, true +} + +// HasIsCritical returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasIsCritical() bool { + return o != nil && o.IsCritical != nil +} + +// SetIsCritical gets a reference to the given bool and assigns it to the IsCritical field. +func (o *SyntheticsTestResultStep) SetIsCritical(v bool) { + o.IsCritical = &v +} + +// GetJavascriptCustomAssertionCode returns the JavascriptCustomAssertionCode field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetJavascriptCustomAssertionCode() bool { + if o == nil || o.JavascriptCustomAssertionCode == nil { + var ret bool + return ret + } + return *o.JavascriptCustomAssertionCode +} + +// GetJavascriptCustomAssertionCodeOk returns a tuple with the JavascriptCustomAssertionCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetJavascriptCustomAssertionCodeOk() (*bool, bool) { + if o == nil || o.JavascriptCustomAssertionCode == nil { + return nil, false + } + return o.JavascriptCustomAssertionCode, true +} + +// HasJavascriptCustomAssertionCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasJavascriptCustomAssertionCode() bool { + return o != nil && o.JavascriptCustomAssertionCode != nil +} + +// SetJavascriptCustomAssertionCode gets a reference to the given bool and assigns it to the JavascriptCustomAssertionCode field. +func (o *SyntheticsTestResultStep) SetJavascriptCustomAssertionCode(v bool) { + o.JavascriptCustomAssertionCode = &v +} + +// GetLocateElementDuration returns the LocateElementDuration field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetLocateElementDuration() float64 { + if o == nil || o.LocateElementDuration == nil { + var ret float64 + return ret + } + return *o.LocateElementDuration +} + +// GetLocateElementDurationOk returns a tuple with the LocateElementDuration field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetLocateElementDurationOk() (*float64, bool) { + if o == nil || o.LocateElementDuration == nil { + return nil, false + } + return o.LocateElementDuration, true +} + +// HasLocateElementDuration returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasLocateElementDuration() bool { + return o != nil && o.LocateElementDuration != nil +} + +// SetLocateElementDuration gets a reference to the given float64 and assigns it to the LocateElementDuration field. +func (o *SyntheticsTestResultStep) SetLocateElementDuration(v float64) { + o.LocateElementDuration = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultStep) SetName(v string) { + o.Name = &v +} + +// GetRequest returns the Request field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetRequest() SyntheticsTestResultRequestInfo { + if o == nil || o.Request == nil { + var ret SyntheticsTestResultRequestInfo + return ret + } + return *o.Request +} + +// GetRequestOk returns a tuple with the Request field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetRequestOk() (*SyntheticsTestResultRequestInfo, bool) { + if o == nil || o.Request == nil { + return nil, false + } + return o.Request, true +} + +// HasRequest returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasRequest() bool { + return o != nil && o.Request != nil +} + +// SetRequest gets a reference to the given SyntheticsTestResultRequestInfo and assigns it to the Request field. +func (o *SyntheticsTestResultStep) SetRequest(v SyntheticsTestResultRequestInfo) { + o.Request = &v +} + +// GetResponse returns the Response field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetResponse() SyntheticsTestResultResponseInfo { + if o == nil || o.Response == nil { + var ret SyntheticsTestResultResponseInfo + return ret + } + return *o.Response +} + +// GetResponseOk returns a tuple with the Response field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetResponseOk() (*SyntheticsTestResultResponseInfo, bool) { + if o == nil || o.Response == nil { + return nil, false + } + return o.Response, true +} + +// HasResponse returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasResponse() bool { + return o != nil && o.Response != nil +} + +// SetResponse gets a reference to the given SyntheticsTestResultResponseInfo and assigns it to the Response field. +func (o *SyntheticsTestResultStep) SetResponse(v SyntheticsTestResultResponseInfo) { + o.Response = &v +} + +// GetRetries returns the Retries field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetRetries() []SyntheticsTestResultStep { + if o == nil || o.Retries == nil { + var ret []SyntheticsTestResultStep + return ret + } + return o.Retries +} + +// GetRetriesOk returns a tuple with the Retries field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetRetriesOk() (*[]SyntheticsTestResultStep, bool) { + if o == nil || o.Retries == nil { + return nil, false + } + return &o.Retries, true +} + +// HasRetries returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasRetries() bool { + return o != nil && o.Retries != nil +} + +// SetRetries gets a reference to the given []SyntheticsTestResultStep and assigns it to the Retries field. +func (o *SyntheticsTestResultStep) SetRetries(v []SyntheticsTestResultStep) { + o.Retries = v +} + +// GetRetryCount returns the RetryCount field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetRetryCount() int64 { + if o == nil || o.RetryCount == nil { + var ret int64 + return ret + } + return *o.RetryCount +} + +// GetRetryCountOk returns a tuple with the RetryCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetRetryCountOk() (*int64, bool) { + if o == nil || o.RetryCount == nil { + return nil, false + } + return o.RetryCount, true +} + +// HasRetryCount returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasRetryCount() bool { + return o != nil && o.RetryCount != nil +} + +// SetRetryCount gets a reference to the given int64 and assigns it to the RetryCount field. +func (o *SyntheticsTestResultStep) SetRetryCount(v int64) { + o.RetryCount = &v +} + +// GetRumContext returns the RumContext field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetRumContext() SyntheticsTestResultRumContext { + if o == nil || o.RumContext == nil { + var ret SyntheticsTestResultRumContext + return ret + } + return *o.RumContext +} + +// GetRumContextOk returns a tuple with the RumContext field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetRumContextOk() (*SyntheticsTestResultRumContext, bool) { + if o == nil || o.RumContext == nil { + return nil, false + } + return o.RumContext, true +} + +// HasRumContext returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasRumContext() bool { + return o != nil && o.RumContext != nil +} + +// SetRumContext gets a reference to the given SyntheticsTestResultRumContext and assigns it to the RumContext field. +func (o *SyntheticsTestResultStep) SetRumContext(v SyntheticsTestResultRumContext) { + o.RumContext = &v +} + +// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetStartedAt() int64 { + if o == nil || o.StartedAt == nil { + var ret int64 + return ret + } + return *o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetStartedAtOk() (*int64, bool) { + if o == nil || o.StartedAt == nil { + return nil, false + } + return o.StartedAt, true +} + +// HasStartedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasStartedAt() bool { + return o != nil && o.StartedAt != nil +} + +// SetStartedAt gets a reference to the given int64 and assigns it to the StartedAt field. +func (o *SyntheticsTestResultStep) SetStartedAt(v int64) { + o.StartedAt = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SyntheticsTestResultStep) SetStatus(v string) { + o.Status = &v +} + +// GetSubStep returns the SubStep field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetSubStep() SyntheticsTestResultSubStep { + if o == nil || o.SubStep == nil { + var ret SyntheticsTestResultSubStep + return ret + } + return *o.SubStep +} + +// GetSubStepOk returns a tuple with the SubStep field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetSubStepOk() (*SyntheticsTestResultSubStep, bool) { + if o == nil || o.SubStep == nil { + return nil, false + } + return o.SubStep, true +} + +// HasSubStep returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasSubStep() bool { + return o != nil && o.SubStep != nil +} + +// SetSubStep gets a reference to the given SyntheticsTestResultSubStep and assigns it to the SubStep field. +func (o *SyntheticsTestResultStep) SetSubStep(v SyntheticsTestResultSubStep) { + o.SubStep = &v +} + +// GetSubTest returns the SubTest field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetSubTest() SyntheticsTestResultSubTest { + if o == nil || o.SubTest == nil { + var ret SyntheticsTestResultSubTest + return ret + } + return *o.SubTest +} + +// GetSubTestOk returns a tuple with the SubTest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetSubTestOk() (*SyntheticsTestResultSubTest, bool) { + if o == nil || o.SubTest == nil { + return nil, false + } + return o.SubTest, true +} + +// HasSubTest returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasSubTest() bool { + return o != nil && o.SubTest != nil +} + +// SetSubTest gets a reference to the given SyntheticsTestResultSubTest and assigns it to the SubTest field. +func (o *SyntheticsTestResultStep) SetSubTest(v SyntheticsTestResultSubTest) { + o.SubTest = &v +} + +// GetSubtype returns the Subtype field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetSubtype() string { + if o == nil || o.Subtype == nil { + var ret string + return ret + } + return *o.Subtype +} + +// GetSubtypeOk returns a tuple with the Subtype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetSubtypeOk() (*string, bool) { + if o == nil || o.Subtype == nil { + return nil, false + } + return o.Subtype, true +} + +// HasSubtype returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasSubtype() bool { + return o != nil && o.Subtype != nil +} + +// SetSubtype gets a reference to the given string and assigns it to the Subtype field. +func (o *SyntheticsTestResultStep) SetSubtype(v string) { + o.Subtype = &v +} + +// GetTabs returns the Tabs field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetTabs() []SyntheticsTestResultTab { + if o == nil || o.Tabs == nil { + var ret []SyntheticsTestResultTab + return ret + } + return o.Tabs +} + +// GetTabsOk returns a tuple with the Tabs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetTabsOk() (*[]SyntheticsTestResultTab, bool) { + if o == nil || o.Tabs == nil { + return nil, false + } + return &o.Tabs, true +} + +// HasTabs returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasTabs() bool { + return o != nil && o.Tabs != nil +} + +// SetTabs gets a reference to the given []SyntheticsTestResultTab and assigns it to the Tabs field. +func (o *SyntheticsTestResultStep) SetTabs(v []SyntheticsTestResultTab) { + o.Tabs = v +} + +// GetTimings returns the Timings field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetTimings() map[string]interface{} { + if o == nil || o.Timings == nil { + var ret map[string]interface{} + return ret + } + return o.Timings +} + +// GetTimingsOk returns a tuple with the Timings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetTimingsOk() (*map[string]interface{}, bool) { + if o == nil || o.Timings == nil { + return nil, false + } + return &o.Timings, true +} + +// HasTimings returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasTimings() bool { + return o != nil && o.Timings != nil +} + +// SetTimings gets a reference to the given map[string]interface{} and assigns it to the Timings field. +func (o *SyntheticsTestResultStep) SetTimings(v map[string]interface{}) { + o.Timings = v +} + +// GetTunnel returns the Tunnel field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetTunnel() bool { + if o == nil || o.Tunnel == nil { + var ret bool + return ret + } + return *o.Tunnel +} + +// GetTunnelOk returns a tuple with the Tunnel field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetTunnelOk() (*bool, bool) { + if o == nil || o.Tunnel == nil { + return nil, false + } + return o.Tunnel, true +} + +// HasTunnel returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasTunnel() bool { + return o != nil && o.Tunnel != nil +} + +// SetTunnel gets a reference to the given bool and assigns it to the Tunnel field. +func (o *SyntheticsTestResultStep) SetTunnel(v bool) { + o.Tunnel = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultStep) SetType(v string) { + o.Type = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultStep) SetUrl(v string) { + o.Url = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetValue() interface{} { + if o == nil || o.Value == nil { + var ret interface{} + return ret + } + return o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetValueOk() (*interface{}, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return &o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given interface{} and assigns it to the Value field. +func (o *SyntheticsTestResultStep) SetValue(v interface{}) { + o.Value = v +} + +// GetVariables returns the Variables field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetVariables() SyntheticsTestResultVariables { + if o == nil || o.Variables == nil { + var ret SyntheticsTestResultVariables + return ret + } + return *o.Variables +} + +// GetVariablesOk returns a tuple with the Variables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetVariablesOk() (*SyntheticsTestResultVariables, bool) { + if o == nil || o.Variables == nil { + return nil, false + } + return o.Variables, true +} + +// HasVariables returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasVariables() bool { + return o != nil && o.Variables != nil +} + +// SetVariables gets a reference to the given SyntheticsTestResultVariables and assigns it to the Variables field. +func (o *SyntheticsTestResultStep) SetVariables(v SyntheticsTestResultVariables) { + o.Variables = &v +} + +// GetVitalsMetrics returns the VitalsMetrics field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetVitalsMetrics() []SyntheticsTestResultVitalsMetrics { + if o == nil || o.VitalsMetrics == nil { + var ret []SyntheticsTestResultVitalsMetrics + return ret + } + return o.VitalsMetrics +} + +// GetVitalsMetricsOk returns a tuple with the VitalsMetrics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetVitalsMetricsOk() (*[]SyntheticsTestResultVitalsMetrics, bool) { + if o == nil || o.VitalsMetrics == nil { + return nil, false + } + return &o.VitalsMetrics, true +} + +// HasVitalsMetrics returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasVitalsMetrics() bool { + return o != nil && o.VitalsMetrics != nil +} + +// SetVitalsMetrics gets a reference to the given []SyntheticsTestResultVitalsMetrics and assigns it to the VitalsMetrics field. +func (o *SyntheticsTestResultStep) SetVitalsMetrics(v []SyntheticsTestResultVitalsMetrics) { + o.VitalsMetrics = v +} + +// GetWarnings returns the Warnings field value if set, zero value otherwise. +func (o *SyntheticsTestResultStep) GetWarnings() []SyntheticsTestResultWarning { + if o == nil || o.Warnings == nil { + var ret []SyntheticsTestResultWarning + return ret + } + return o.Warnings +} + +// GetWarningsOk returns a tuple with the Warnings field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStep) GetWarningsOk() (*[]SyntheticsTestResultWarning, bool) { + if o == nil || o.Warnings == nil { + return nil, false + } + return &o.Warnings, true +} + +// HasWarnings returns a boolean if a field has been set. +func (o *SyntheticsTestResultStep) HasWarnings() bool { + return o != nil && o.Warnings != nil +} + +// SetWarnings gets a reference to the given []SyntheticsTestResultWarning and assigns it to the Warnings field. +func (o *SyntheticsTestResultStep) SetWarnings(v []SyntheticsTestResultWarning) { + o.Warnings = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultStep) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.AllowFailure != nil { + toSerialize["allow_failure"] = o.AllowFailure + } + if o.ApiTest != nil { + toSerialize["api_test"] = o.ApiTest + } + if o.AssertionResult != nil { + toSerialize["assertion_result"] = o.AssertionResult + } + if o.Assertions != nil { + toSerialize["assertions"] = o.Assertions + } + if o.BlockedRequestsUrls != nil { + toSerialize["blocked_requests_urls"] = o.BlockedRequestsUrls + } + if o.Bounds != nil { + toSerialize["bounds"] = o.Bounds + } + if o.BrowserErrors != nil { + toSerialize["browser_errors"] = o.BrowserErrors + } + if o.BucketKeys != nil { + toSerialize["bucket_keys"] = o.BucketKeys + } + if o.CdnResources != nil { + toSerialize["cdn_resources"] = o.CdnResources + } + if o.ClickType != nil { + toSerialize["click_type"] = o.ClickType + } + if o.CompressedJsonDescriptor != nil { + toSerialize["compressed_json_descriptor"] = o.CompressedJsonDescriptor + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Duration != nil { + toSerialize["duration"] = o.Duration + } + if o.ElementDescription != nil { + toSerialize["element_description"] = o.ElementDescription + } + if o.ElementUpdates != nil { + toSerialize["element_updates"] = o.ElementUpdates + } + if o.ExtractedValue != nil { + toSerialize["extracted_value"] = o.ExtractedValue + } + if o.Failure != nil { + toSerialize["failure"] = o.Failure + } + if o.HttpResults != nil { + toSerialize["http_results"] = o.HttpResults + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.IsCritical != nil { + toSerialize["is_critical"] = o.IsCritical + } + if o.JavascriptCustomAssertionCode != nil { + toSerialize["javascript_custom_assertion_code"] = o.JavascriptCustomAssertionCode + } + if o.LocateElementDuration != nil { + toSerialize["locate_element_duration"] = o.LocateElementDuration + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Request != nil { + toSerialize["request"] = o.Request + } + if o.Response != nil { + toSerialize["response"] = o.Response + } + if o.Retries != nil { + toSerialize["retries"] = o.Retries + } + if o.RetryCount != nil { + toSerialize["retry_count"] = o.RetryCount + } + if o.RumContext != nil { + toSerialize["rum_context"] = o.RumContext + } + if o.StartedAt != nil { + toSerialize["started_at"] = o.StartedAt + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.SubStep != nil { + toSerialize["sub_step"] = o.SubStep + } + if o.SubTest != nil { + toSerialize["sub_test"] = o.SubTest + } + if o.Subtype != nil { + toSerialize["subtype"] = o.Subtype + } + if o.Tabs != nil { + toSerialize["tabs"] = o.Tabs + } + if o.Timings != nil { + toSerialize["timings"] = o.Timings + } + if o.Tunnel != nil { + toSerialize["tunnel"] = o.Tunnel + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + if o.Variables != nil { + toSerialize["variables"] = o.Variables + } + if o.VitalsMetrics != nil { + toSerialize["vitals_metrics"] = o.VitalsMetrics + } + if o.Warnings != nil { + toSerialize["warnings"] = o.Warnings + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultStep) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AllowFailure *bool `json:"allow_failure,omitempty"` + ApiTest map[string]interface{} `json:"api_test,omitempty"` + AssertionResult *SyntheticsTestResultStepAssertionResult `json:"assertion_result,omitempty"` + Assertions []SyntheticsTestResultAssertionResult `json:"assertions,omitempty"` + BlockedRequestsUrls []string `json:"blocked_requests_urls,omitempty"` + Bounds *SyntheticsTestResultBounds `json:"bounds,omitempty"` + BrowserErrors []SyntheticsTestResultBrowserError `json:"browser_errors,omitempty"` + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + CdnResources []SyntheticsTestResultCdnResource `json:"cdn_resources,omitempty"` + ClickType *string `json:"click_type,omitempty"` + CompressedJsonDescriptor *string `json:"compressed_json_descriptor,omitempty"` + Config map[string]interface{} `json:"config,omitempty"` + Description *string `json:"description,omitempty"` + Duration *float64 `json:"duration,omitempty"` + ElementDescription *string `json:"element_description,omitempty"` + ElementUpdates *SyntheticsTestResultStepElementUpdates `json:"element_updates,omitempty"` + ExtractedValue *SyntheticsTestResultVariable `json:"extracted_value,omitempty"` + Failure *SyntheticsTestResultFailure `json:"failure,omitempty"` + HttpResults []SyntheticsTestResultAssertionResult `json:"http_results,omitempty"` + Id *string `json:"id,omitempty"` + IsCritical *bool `json:"is_critical,omitempty"` + JavascriptCustomAssertionCode *bool `json:"javascript_custom_assertion_code,omitempty"` + LocateElementDuration *float64 `json:"locate_element_duration,omitempty"` + Name *string `json:"name,omitempty"` + Request *SyntheticsTestResultRequestInfo `json:"request,omitempty"` + Response *SyntheticsTestResultResponseInfo `json:"response,omitempty"` + Retries []SyntheticsTestResultStep `json:"retries,omitempty"` + RetryCount *int64 `json:"retry_count,omitempty"` + RumContext *SyntheticsTestResultRumContext `json:"rum_context,omitempty"` + StartedAt *int64 `json:"started_at,omitempty"` + Status *string `json:"status,omitempty"` + SubStep *SyntheticsTestResultSubStep `json:"sub_step,omitempty"` + SubTest *SyntheticsTestResultSubTest `json:"sub_test,omitempty"` + Subtype *string `json:"subtype,omitempty"` + Tabs []SyntheticsTestResultTab `json:"tabs,omitempty"` + Timings map[string]interface{} `json:"timings,omitempty"` + Tunnel *bool `json:"tunnel,omitempty"` + Type *string `json:"type,omitempty"` + Url *string `json:"url,omitempty"` + Value interface{} `json:"value,omitempty"` + Variables *SyntheticsTestResultVariables `json:"variables,omitempty"` + VitalsMetrics []SyntheticsTestResultVitalsMetrics `json:"vitals_metrics,omitempty"` + Warnings []SyntheticsTestResultWarning `json:"warnings,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"allow_failure", "api_test", "assertion_result", "assertions", "blocked_requests_urls", "bounds", "browser_errors", "bucket_keys", "cdn_resources", "click_type", "compressed_json_descriptor", "config", "description", "duration", "element_description", "element_updates", "extracted_value", "failure", "http_results", "id", "is_critical", "javascript_custom_assertion_code", "locate_element_duration", "name", "request", "response", "retries", "retry_count", "rum_context", "started_at", "status", "sub_step", "sub_test", "subtype", "tabs", "timings", "tunnel", "type", "url", "value", "variables", "vitals_metrics", "warnings"}) + } else { + return err + } + + hasInvalidField := false + o.AllowFailure = all.AllowFailure + o.ApiTest = all.ApiTest + if all.AssertionResult != nil && all.AssertionResult.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.AssertionResult = all.AssertionResult + o.Assertions = all.Assertions + o.BlockedRequestsUrls = all.BlockedRequestsUrls + if all.Bounds != nil && all.Bounds.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Bounds = all.Bounds + o.BrowserErrors = all.BrowserErrors + if all.BucketKeys != nil && all.BucketKeys.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BucketKeys = all.BucketKeys + o.CdnResources = all.CdnResources + o.ClickType = all.ClickType + o.CompressedJsonDescriptor = all.CompressedJsonDescriptor + o.Config = all.Config + o.Description = all.Description + o.Duration = all.Duration + o.ElementDescription = all.ElementDescription + if all.ElementUpdates != nil && all.ElementUpdates.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ElementUpdates = all.ElementUpdates + if all.ExtractedValue != nil && all.ExtractedValue.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ExtractedValue = all.ExtractedValue + if all.Failure != nil && all.Failure.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Failure = all.Failure + o.HttpResults = all.HttpResults + o.Id = all.Id + o.IsCritical = all.IsCritical + o.JavascriptCustomAssertionCode = all.JavascriptCustomAssertionCode + o.LocateElementDuration = all.LocateElementDuration + o.Name = all.Name + if all.Request != nil && all.Request.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Request = all.Request + if all.Response != nil && all.Response.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Response = all.Response + o.Retries = all.Retries + o.RetryCount = all.RetryCount + if all.RumContext != nil && all.RumContext.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.RumContext = all.RumContext + o.StartedAt = all.StartedAt + o.Status = all.Status + if all.SubStep != nil && all.SubStep.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.SubStep = all.SubStep + if all.SubTest != nil && all.SubTest.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.SubTest = all.SubTest + o.Subtype = all.Subtype + o.Tabs = all.Tabs + o.Timings = all.Timings + o.Tunnel = all.Tunnel + o.Type = all.Type + o.Url = all.Url + o.Value = all.Value + if all.Variables != nil && all.Variables.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Variables = all.Variables + o.VitalsMetrics = all.VitalsMetrics + o.Warnings = all.Warnings + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_step_assertion_result.go b/api/datadogV2/model_synthetics_test_result_step_assertion_result.go new file mode 100644 index 00000000000..0685cfb1f46 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_step_assertion_result.go @@ -0,0 +1,207 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultStepAssertionResult Assertion result for a browser or mobile step. +type SyntheticsTestResultStepAssertionResult struct { + // Actual value observed during the step assertion. Its type depends on the check type. + Actual interface{} `json:"actual,omitempty"` + // Type of the step assertion check. + CheckType *string `json:"check_type,omitempty"` + // Expected value for the step assertion. Its type depends on the check type. + Expected interface{} `json:"expected,omitempty"` + // Whether the assertion involves secure variables. + HasSecureVariables *bool `json:"has_secure_variables,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultStepAssertionResult instantiates a new SyntheticsTestResultStepAssertionResult object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultStepAssertionResult() *SyntheticsTestResultStepAssertionResult { + this := SyntheticsTestResultStepAssertionResult{} + return &this +} + +// NewSyntheticsTestResultStepAssertionResultWithDefaults instantiates a new SyntheticsTestResultStepAssertionResult object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultStepAssertionResultWithDefaults() *SyntheticsTestResultStepAssertionResult { + this := SyntheticsTestResultStepAssertionResult{} + return &this +} + +// GetActual returns the Actual field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepAssertionResult) GetActual() interface{} { + if o == nil || o.Actual == nil { + var ret interface{} + return ret + } + return o.Actual +} + +// GetActualOk returns a tuple with the Actual field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepAssertionResult) GetActualOk() (*interface{}, bool) { + if o == nil || o.Actual == nil { + return nil, false + } + return &o.Actual, true +} + +// HasActual returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepAssertionResult) HasActual() bool { + return o != nil && o.Actual != nil +} + +// SetActual gets a reference to the given interface{} and assigns it to the Actual field. +func (o *SyntheticsTestResultStepAssertionResult) SetActual(v interface{}) { + o.Actual = v +} + +// GetCheckType returns the CheckType field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepAssertionResult) GetCheckType() string { + if o == nil || o.CheckType == nil { + var ret string + return ret + } + return *o.CheckType +} + +// GetCheckTypeOk returns a tuple with the CheckType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepAssertionResult) GetCheckTypeOk() (*string, bool) { + if o == nil || o.CheckType == nil { + return nil, false + } + return o.CheckType, true +} + +// HasCheckType returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepAssertionResult) HasCheckType() bool { + return o != nil && o.CheckType != nil +} + +// SetCheckType gets a reference to the given string and assigns it to the CheckType field. +func (o *SyntheticsTestResultStepAssertionResult) SetCheckType(v string) { + o.CheckType = &v +} + +// GetExpected returns the Expected field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepAssertionResult) GetExpected() interface{} { + if o == nil || o.Expected == nil { + var ret interface{} + return ret + } + return o.Expected +} + +// GetExpectedOk returns a tuple with the Expected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepAssertionResult) GetExpectedOk() (*interface{}, bool) { + if o == nil || o.Expected == nil { + return nil, false + } + return &o.Expected, true +} + +// HasExpected returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepAssertionResult) HasExpected() bool { + return o != nil && o.Expected != nil +} + +// SetExpected gets a reference to the given interface{} and assigns it to the Expected field. +func (o *SyntheticsTestResultStepAssertionResult) SetExpected(v interface{}) { + o.Expected = v +} + +// GetHasSecureVariables returns the HasSecureVariables field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepAssertionResult) GetHasSecureVariables() bool { + if o == nil || o.HasSecureVariables == nil { + var ret bool + return ret + } + return *o.HasSecureVariables +} + +// GetHasSecureVariablesOk returns a tuple with the HasSecureVariables field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepAssertionResult) GetHasSecureVariablesOk() (*bool, bool) { + if o == nil || o.HasSecureVariables == nil { + return nil, false + } + return o.HasSecureVariables, true +} + +// HasHasSecureVariables returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepAssertionResult) HasHasSecureVariables() bool { + return o != nil && o.HasSecureVariables != nil +} + +// SetHasSecureVariables gets a reference to the given bool and assigns it to the HasSecureVariables field. +func (o *SyntheticsTestResultStepAssertionResult) SetHasSecureVariables(v bool) { + o.HasSecureVariables = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultStepAssertionResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Actual != nil { + toSerialize["actual"] = o.Actual + } + if o.CheckType != nil { + toSerialize["check_type"] = o.CheckType + } + if o.Expected != nil { + toSerialize["expected"] = o.Expected + } + if o.HasSecureVariables != nil { + toSerialize["has_secure_variables"] = o.HasSecureVariables + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultStepAssertionResult) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Actual interface{} `json:"actual,omitempty"` + CheckType *string `json:"check_type,omitempty"` + Expected interface{} `json:"expected,omitempty"` + HasSecureVariables *bool `json:"has_secure_variables,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"actual", "check_type", "expected", "has_secure_variables"}) + } else { + return err + } + o.Actual = all.Actual + o.CheckType = all.CheckType + o.Expected = all.Expected + o.HasSecureVariables = all.HasSecureVariables + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_step_element_updates.go b/api/datadogV2/model_synthetics_test_result_step_element_updates.go new file mode 100644 index 00000000000..f3ec992c09c --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_step_element_updates.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultStepElementUpdates Element locator updates produced during a step. +type SyntheticsTestResultStepElementUpdates struct { + // Updated multi-locator definition. + MultiLocator map[string]string `json:"multi_locator,omitempty"` + // Updated outer HTML of the targeted element. + TargetOuterHtml *string `json:"target_outer_html,omitempty"` + // Version of the element locator definition. + Version *int64 `json:"version,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultStepElementUpdates instantiates a new SyntheticsTestResultStepElementUpdates object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultStepElementUpdates() *SyntheticsTestResultStepElementUpdates { + this := SyntheticsTestResultStepElementUpdates{} + return &this +} + +// NewSyntheticsTestResultStepElementUpdatesWithDefaults instantiates a new SyntheticsTestResultStepElementUpdates object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultStepElementUpdatesWithDefaults() *SyntheticsTestResultStepElementUpdates { + this := SyntheticsTestResultStepElementUpdates{} + return &this +} + +// GetMultiLocator returns the MultiLocator field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepElementUpdates) GetMultiLocator() map[string]string { + if o == nil || o.MultiLocator == nil { + var ret map[string]string + return ret + } + return o.MultiLocator +} + +// GetMultiLocatorOk returns a tuple with the MultiLocator field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepElementUpdates) GetMultiLocatorOk() (*map[string]string, bool) { + if o == nil || o.MultiLocator == nil { + return nil, false + } + return &o.MultiLocator, true +} + +// HasMultiLocator returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepElementUpdates) HasMultiLocator() bool { + return o != nil && o.MultiLocator != nil +} + +// SetMultiLocator gets a reference to the given map[string]string and assigns it to the MultiLocator field. +func (o *SyntheticsTestResultStepElementUpdates) SetMultiLocator(v map[string]string) { + o.MultiLocator = v +} + +// GetTargetOuterHtml returns the TargetOuterHtml field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepElementUpdates) GetTargetOuterHtml() string { + if o == nil || o.TargetOuterHtml == nil { + var ret string + return ret + } + return *o.TargetOuterHtml +} + +// GetTargetOuterHtmlOk returns a tuple with the TargetOuterHtml field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepElementUpdates) GetTargetOuterHtmlOk() (*string, bool) { + if o == nil || o.TargetOuterHtml == nil { + return nil, false + } + return o.TargetOuterHtml, true +} + +// HasTargetOuterHtml returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepElementUpdates) HasTargetOuterHtml() bool { + return o != nil && o.TargetOuterHtml != nil +} + +// SetTargetOuterHtml gets a reference to the given string and assigns it to the TargetOuterHtml field. +func (o *SyntheticsTestResultStepElementUpdates) SetTargetOuterHtml(v string) { + o.TargetOuterHtml = &v +} + +// GetVersion returns the Version field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepElementUpdates) GetVersion() int64 { + if o == nil || o.Version == nil { + var ret int64 + return ret + } + return *o.Version +} + +// GetVersionOk returns a tuple with the Version field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepElementUpdates) GetVersionOk() (*int64, bool) { + if o == nil || o.Version == nil { + return nil, false + } + return o.Version, true +} + +// HasVersion returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepElementUpdates) HasVersion() bool { + return o != nil && o.Version != nil +} + +// SetVersion gets a reference to the given int64 and assigns it to the Version field. +func (o *SyntheticsTestResultStepElementUpdates) SetVersion(v int64) { + o.Version = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultStepElementUpdates) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.MultiLocator != nil { + toSerialize["multi_locator"] = o.MultiLocator + } + if o.TargetOuterHtml != nil { + toSerialize["target_outer_html"] = o.TargetOuterHtml + } + if o.Version != nil { + toSerialize["version"] = o.Version + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultStepElementUpdates) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + MultiLocator map[string]string `json:"multi_locator,omitempty"` + TargetOuterHtml *string `json:"target_outer_html,omitempty"` + Version *int64 `json:"version,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"multi_locator", "target_outer_html", "version"}) + } else { + return err + } + o.MultiLocator = all.MultiLocator + o.TargetOuterHtml = all.TargetOuterHtml + o.Version = all.Version + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_steps_info.go b/api/datadogV2/model_synthetics_test_result_steps_info.go new file mode 100644 index 00000000000..dc9b5fcd83f --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_steps_info.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultStepsInfo Step execution summary for a Synthetic test result. +type SyntheticsTestResultStepsInfo struct { + // Number of completed steps. + Completed *int64 `json:"completed,omitempty"` + // Number of steps with errors. + Errors *int64 `json:"errors,omitempty"` + // Total number of steps. + Total *int64 `json:"total,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultStepsInfo instantiates a new SyntheticsTestResultStepsInfo object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultStepsInfo() *SyntheticsTestResultStepsInfo { + this := SyntheticsTestResultStepsInfo{} + return &this +} + +// NewSyntheticsTestResultStepsInfoWithDefaults instantiates a new SyntheticsTestResultStepsInfo object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultStepsInfoWithDefaults() *SyntheticsTestResultStepsInfo { + this := SyntheticsTestResultStepsInfo{} + return &this +} + +// GetCompleted returns the Completed field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepsInfo) GetCompleted() int64 { + if o == nil || o.Completed == nil { + var ret int64 + return ret + } + return *o.Completed +} + +// GetCompletedOk returns a tuple with the Completed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepsInfo) GetCompletedOk() (*int64, bool) { + if o == nil || o.Completed == nil { + return nil, false + } + return o.Completed, true +} + +// HasCompleted returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepsInfo) HasCompleted() bool { + return o != nil && o.Completed != nil +} + +// SetCompleted gets a reference to the given int64 and assigns it to the Completed field. +func (o *SyntheticsTestResultStepsInfo) SetCompleted(v int64) { + o.Completed = &v +} + +// GetErrors returns the Errors field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepsInfo) GetErrors() int64 { + if o == nil || o.Errors == nil { + var ret int64 + return ret + } + return *o.Errors +} + +// GetErrorsOk returns a tuple with the Errors field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepsInfo) GetErrorsOk() (*int64, bool) { + if o == nil || o.Errors == nil { + return nil, false + } + return o.Errors, true +} + +// HasErrors returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepsInfo) HasErrors() bool { + return o != nil && o.Errors != nil +} + +// SetErrors gets a reference to the given int64 and assigns it to the Errors field. +func (o *SyntheticsTestResultStepsInfo) SetErrors(v int64) { + o.Errors = &v +} + +// GetTotal returns the Total field value if set, zero value otherwise. +func (o *SyntheticsTestResultStepsInfo) GetTotal() int64 { + if o == nil || o.Total == nil { + var ret int64 + return ret + } + return *o.Total +} + +// GetTotalOk returns a tuple with the Total field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultStepsInfo) GetTotalOk() (*int64, bool) { + if o == nil || o.Total == nil { + return nil, false + } + return o.Total, true +} + +// HasTotal returns a boolean if a field has been set. +func (o *SyntheticsTestResultStepsInfo) HasTotal() bool { + return o != nil && o.Total != nil +} + +// SetTotal gets a reference to the given int64 and assigns it to the Total field. +func (o *SyntheticsTestResultStepsInfo) SetTotal(v int64) { + o.Total = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultStepsInfo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Completed != nil { + toSerialize["completed"] = o.Completed + } + if o.Errors != nil { + toSerialize["errors"] = o.Errors + } + if o.Total != nil { + toSerialize["total"] = o.Total + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultStepsInfo) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Completed *int64 `json:"completed,omitempty"` + Errors *int64 `json:"errors,omitempty"` + Total *int64 `json:"total,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"completed", "errors", "total"}) + } else { + return err + } + o.Completed = all.Completed + o.Errors = all.Errors + o.Total = all.Total + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_sub_step.go b/api/datadogV2/model_synthetics_test_result_sub_step.go new file mode 100644 index 00000000000..94918325018 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_sub_step.go @@ -0,0 +1,184 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultSubStep Information about a sub-step in a nested test execution. +type SyntheticsTestResultSubStep struct { + // Depth of the sub-step in the execution tree. + Level *int64 `json:"level,omitempty"` + // Reference to the parent step of a sub-step. + ParentStep *SyntheticsTestResultParentStep `json:"parent_step,omitempty"` + // Reference to the parent test of a sub-step. + ParentTest *SyntheticsTestResultParentTest `json:"parent_test,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultSubStep instantiates a new SyntheticsTestResultSubStep object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultSubStep() *SyntheticsTestResultSubStep { + this := SyntheticsTestResultSubStep{} + return &this +} + +// NewSyntheticsTestResultSubStepWithDefaults instantiates a new SyntheticsTestResultSubStep object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultSubStepWithDefaults() *SyntheticsTestResultSubStep { + this := SyntheticsTestResultSubStep{} + return &this +} + +// GetLevel returns the Level field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubStep) GetLevel() int64 { + if o == nil || o.Level == nil { + var ret int64 + return ret + } + return *o.Level +} + +// GetLevelOk returns a tuple with the Level field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubStep) GetLevelOk() (*int64, bool) { + if o == nil || o.Level == nil { + return nil, false + } + return o.Level, true +} + +// HasLevel returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubStep) HasLevel() bool { + return o != nil && o.Level != nil +} + +// SetLevel gets a reference to the given int64 and assigns it to the Level field. +func (o *SyntheticsTestResultSubStep) SetLevel(v int64) { + o.Level = &v +} + +// GetParentStep returns the ParentStep field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubStep) GetParentStep() SyntheticsTestResultParentStep { + if o == nil || o.ParentStep == nil { + var ret SyntheticsTestResultParentStep + return ret + } + return *o.ParentStep +} + +// GetParentStepOk returns a tuple with the ParentStep field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubStep) GetParentStepOk() (*SyntheticsTestResultParentStep, bool) { + if o == nil || o.ParentStep == nil { + return nil, false + } + return o.ParentStep, true +} + +// HasParentStep returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubStep) HasParentStep() bool { + return o != nil && o.ParentStep != nil +} + +// SetParentStep gets a reference to the given SyntheticsTestResultParentStep and assigns it to the ParentStep field. +func (o *SyntheticsTestResultSubStep) SetParentStep(v SyntheticsTestResultParentStep) { + o.ParentStep = &v +} + +// GetParentTest returns the ParentTest field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubStep) GetParentTest() SyntheticsTestResultParentTest { + if o == nil || o.ParentTest == nil { + var ret SyntheticsTestResultParentTest + return ret + } + return *o.ParentTest +} + +// GetParentTestOk returns a tuple with the ParentTest field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubStep) GetParentTestOk() (*SyntheticsTestResultParentTest, bool) { + if o == nil || o.ParentTest == nil { + return nil, false + } + return o.ParentTest, true +} + +// HasParentTest returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubStep) HasParentTest() bool { + return o != nil && o.ParentTest != nil +} + +// SetParentTest gets a reference to the given SyntheticsTestResultParentTest and assigns it to the ParentTest field. +func (o *SyntheticsTestResultSubStep) SetParentTest(v SyntheticsTestResultParentTest) { + o.ParentTest = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultSubStep) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Level != nil { + toSerialize["level"] = o.Level + } + if o.ParentStep != nil { + toSerialize["parent_step"] = o.ParentStep + } + if o.ParentTest != nil { + toSerialize["parent_test"] = o.ParentTest + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultSubStep) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Level *int64 `json:"level,omitempty"` + ParentStep *SyntheticsTestResultParentStep `json:"parent_step,omitempty"` + ParentTest *SyntheticsTestResultParentTest `json:"parent_test,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"level", "parent_step", "parent_test"}) + } else { + return err + } + + hasInvalidField := false + o.Level = all.Level + if all.ParentStep != nil && all.ParentStep.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ParentStep = all.ParentStep + if all.ParentTest != nil && all.ParentTest.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ParentTest = all.ParentTest + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_sub_test_.go b/api/datadogV2/model_synthetics_test_result_sub_test_.go new file mode 100644 index 00000000000..0f01d4871e1 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_sub_test_.go @@ -0,0 +1,181 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultSubTest Information about a sub-test played from a parent browser test. +type SyntheticsTestResultSubTest struct { + // Identifier of the sub-test. + Id *string `json:"id,omitempty"` + // Index of the browser tab playing the sub-test. + PlayingTab *int64 `json:"playing_tab,omitempty"` + // RUM application context associated with a step or sub-test. + RumContext *SyntheticsTestResultRumContext `json:"rum_context,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultSubTest instantiates a new SyntheticsTestResultSubTest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultSubTest() *SyntheticsTestResultSubTest { + this := SyntheticsTestResultSubTest{} + return &this +} + +// NewSyntheticsTestResultSubTestWithDefaults instantiates a new SyntheticsTestResultSubTest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultSubTestWithDefaults() *SyntheticsTestResultSubTest { + this := SyntheticsTestResultSubTest{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubTest) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubTest) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubTest) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultSubTest) SetId(v string) { + o.Id = &v +} + +// GetPlayingTab returns the PlayingTab field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubTest) GetPlayingTab() int64 { + if o == nil || o.PlayingTab == nil { + var ret int64 + return ret + } + return *o.PlayingTab +} + +// GetPlayingTabOk returns a tuple with the PlayingTab field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubTest) GetPlayingTabOk() (*int64, bool) { + if o == nil || o.PlayingTab == nil { + return nil, false + } + return o.PlayingTab, true +} + +// HasPlayingTab returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubTest) HasPlayingTab() bool { + return o != nil && o.PlayingTab != nil +} + +// SetPlayingTab gets a reference to the given int64 and assigns it to the PlayingTab field. +func (o *SyntheticsTestResultSubTest) SetPlayingTab(v int64) { + o.PlayingTab = &v +} + +// GetRumContext returns the RumContext field value if set, zero value otherwise. +func (o *SyntheticsTestResultSubTest) GetRumContext() SyntheticsTestResultRumContext { + if o == nil || o.RumContext == nil { + var ret SyntheticsTestResultRumContext + return ret + } + return *o.RumContext +} + +// GetRumContextOk returns a tuple with the RumContext field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSubTest) GetRumContextOk() (*SyntheticsTestResultRumContext, bool) { + if o == nil || o.RumContext == nil { + return nil, false + } + return o.RumContext, true +} + +// HasRumContext returns a boolean if a field has been set. +func (o *SyntheticsTestResultSubTest) HasRumContext() bool { + return o != nil && o.RumContext != nil +} + +// SetRumContext gets a reference to the given SyntheticsTestResultRumContext and assigns it to the RumContext field. +func (o *SyntheticsTestResultSubTest) SetRumContext(v SyntheticsTestResultRumContext) { + o.RumContext = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultSubTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.PlayingTab != nil { + toSerialize["playing_tab"] = o.PlayingTab + } + if o.RumContext != nil { + toSerialize["rum_context"] = o.RumContext + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultSubTest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Id *string `json:"id,omitempty"` + PlayingTab *int64 `json:"playing_tab,omitempty"` + RumContext *SyntheticsTestResultRumContext `json:"rum_context,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"id", "playing_tab", "rum_context"}) + } else { + return err + } + + hasInvalidField := false + o.Id = all.Id + o.PlayingTab = all.PlayingTab + if all.RumContext != nil && all.RumContext.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.RumContext = all.RumContext + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_summary_attributes.go b/api/datadogV2/model_synthetics_test_result_summary_attributes.go new file mode 100644 index 00000000000..2fe3fb88e9d --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_summary_attributes.go @@ -0,0 +1,451 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultSummaryAttributes Attributes of a Synthetic test result summary. +type SyntheticsTestResultSummaryAttributes struct { + // Device information for the test result (browser and mobile tests). + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + // Execution details for a Synthetic test result. + ExecutionInfo *SyntheticsTestResultExecutionInfo `json:"execution_info,omitempty"` + // Timestamp of when the test finished (in milliseconds). + FinishedAt *int64 `json:"finished_at,omitempty"` + // Location information for a Synthetic test result. + Location *SyntheticsTestResultLocation `json:"location,omitempty"` + // The type of run for a Synthetic test result. + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` + // Timestamp of when the test started (in milliseconds). + StartedAt *int64 `json:"started_at,omitempty"` + // Status of a Synthetic test result. + Status *SyntheticsTestResultStatus `json:"status,omitempty"` + // Step execution summary for a Synthetic test result. + StepsInfo *SyntheticsTestResultStepsInfo `json:"steps_info,omitempty"` + // Subtype of the Synthetic test that produced this result. + TestSubType *SyntheticsTestSubType `json:"test_sub_type,omitempty"` + // Type of the Synthetic test that produced this result. + TestType *SyntheticsTestType `json:"test_type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultSummaryAttributes instantiates a new SyntheticsTestResultSummaryAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultSummaryAttributes() *SyntheticsTestResultSummaryAttributes { + this := SyntheticsTestResultSummaryAttributes{} + return &this +} + +// NewSyntheticsTestResultSummaryAttributesWithDefaults instantiates a new SyntheticsTestResultSummaryAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultSummaryAttributesWithDefaults() *SyntheticsTestResultSummaryAttributes { + this := SyntheticsTestResultSummaryAttributes{} + return &this +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetDevice() SyntheticsTestResultDevice { + if o == nil || o.Device == nil { + var ret SyntheticsTestResultDevice + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetDeviceOk() (*SyntheticsTestResultDevice, bool) { + if o == nil || o.Device == nil { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasDevice() bool { + return o != nil && o.Device != nil +} + +// SetDevice gets a reference to the given SyntheticsTestResultDevice and assigns it to the Device field. +func (o *SyntheticsTestResultSummaryAttributes) SetDevice(v SyntheticsTestResultDevice) { + o.Device = &v +} + +// GetExecutionInfo returns the ExecutionInfo field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetExecutionInfo() SyntheticsTestResultExecutionInfo { + if o == nil || o.ExecutionInfo == nil { + var ret SyntheticsTestResultExecutionInfo + return ret + } + return *o.ExecutionInfo +} + +// GetExecutionInfoOk returns a tuple with the ExecutionInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetExecutionInfoOk() (*SyntheticsTestResultExecutionInfo, bool) { + if o == nil || o.ExecutionInfo == nil { + return nil, false + } + return o.ExecutionInfo, true +} + +// HasExecutionInfo returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasExecutionInfo() bool { + return o != nil && o.ExecutionInfo != nil +} + +// SetExecutionInfo gets a reference to the given SyntheticsTestResultExecutionInfo and assigns it to the ExecutionInfo field. +func (o *SyntheticsTestResultSummaryAttributes) SetExecutionInfo(v SyntheticsTestResultExecutionInfo) { + o.ExecutionInfo = &v +} + +// GetFinishedAt returns the FinishedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetFinishedAt() int64 { + if o == nil || o.FinishedAt == nil { + var ret int64 + return ret + } + return *o.FinishedAt +} + +// GetFinishedAtOk returns a tuple with the FinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetFinishedAtOk() (*int64, bool) { + if o == nil || o.FinishedAt == nil { + return nil, false + } + return o.FinishedAt, true +} + +// HasFinishedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasFinishedAt() bool { + return o != nil && o.FinishedAt != nil +} + +// SetFinishedAt gets a reference to the given int64 and assigns it to the FinishedAt field. +func (o *SyntheticsTestResultSummaryAttributes) SetFinishedAt(v int64) { + o.FinishedAt = &v +} + +// GetLocation returns the Location field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetLocation() SyntheticsTestResultLocation { + if o == nil || o.Location == nil { + var ret SyntheticsTestResultLocation + return ret + } + return *o.Location +} + +// GetLocationOk returns a tuple with the Location field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetLocationOk() (*SyntheticsTestResultLocation, bool) { + if o == nil || o.Location == nil { + return nil, false + } + return o.Location, true +} + +// HasLocation returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasLocation() bool { + return o != nil && o.Location != nil +} + +// SetLocation gets a reference to the given SyntheticsTestResultLocation and assigns it to the Location field. +func (o *SyntheticsTestResultSummaryAttributes) SetLocation(v SyntheticsTestResultLocation) { + o.Location = &v +} + +// GetRunType returns the RunType field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetRunType() SyntheticsTestResultRunType { + if o == nil || o.RunType == nil { + var ret SyntheticsTestResultRunType + return ret + } + return *o.RunType +} + +// GetRunTypeOk returns a tuple with the RunType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetRunTypeOk() (*SyntheticsTestResultRunType, bool) { + if o == nil || o.RunType == nil { + return nil, false + } + return o.RunType, true +} + +// HasRunType returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasRunType() bool { + return o != nil && o.RunType != nil +} + +// SetRunType gets a reference to the given SyntheticsTestResultRunType and assigns it to the RunType field. +func (o *SyntheticsTestResultSummaryAttributes) SetRunType(v SyntheticsTestResultRunType) { + o.RunType = &v +} + +// GetStartedAt returns the StartedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetStartedAt() int64 { + if o == nil || o.StartedAt == nil { + var ret int64 + return ret + } + return *o.StartedAt +} + +// GetStartedAtOk returns a tuple with the StartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetStartedAtOk() (*int64, bool) { + if o == nil || o.StartedAt == nil { + return nil, false + } + return o.StartedAt, true +} + +// HasStartedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasStartedAt() bool { + return o != nil && o.StartedAt != nil +} + +// SetStartedAt gets a reference to the given int64 and assigns it to the StartedAt field. +func (o *SyntheticsTestResultSummaryAttributes) SetStartedAt(v int64) { + o.StartedAt = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetStatus() SyntheticsTestResultStatus { + if o == nil || o.Status == nil { + var ret SyntheticsTestResultStatus + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetStatusOk() (*SyntheticsTestResultStatus, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given SyntheticsTestResultStatus and assigns it to the Status field. +func (o *SyntheticsTestResultSummaryAttributes) SetStatus(v SyntheticsTestResultStatus) { + o.Status = &v +} + +// GetStepsInfo returns the StepsInfo field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetStepsInfo() SyntheticsTestResultStepsInfo { + if o == nil || o.StepsInfo == nil { + var ret SyntheticsTestResultStepsInfo + return ret + } + return *o.StepsInfo +} + +// GetStepsInfoOk returns a tuple with the StepsInfo field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetStepsInfoOk() (*SyntheticsTestResultStepsInfo, bool) { + if o == nil || o.StepsInfo == nil { + return nil, false + } + return o.StepsInfo, true +} + +// HasStepsInfo returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasStepsInfo() bool { + return o != nil && o.StepsInfo != nil +} + +// SetStepsInfo gets a reference to the given SyntheticsTestResultStepsInfo and assigns it to the StepsInfo field. +func (o *SyntheticsTestResultSummaryAttributes) SetStepsInfo(v SyntheticsTestResultStepsInfo) { + o.StepsInfo = &v +} + +// GetTestSubType returns the TestSubType field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetTestSubType() SyntheticsTestSubType { + if o == nil || o.TestSubType == nil { + var ret SyntheticsTestSubType + return ret + } + return *o.TestSubType +} + +// GetTestSubTypeOk returns a tuple with the TestSubType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetTestSubTypeOk() (*SyntheticsTestSubType, bool) { + if o == nil || o.TestSubType == nil { + return nil, false + } + return o.TestSubType, true +} + +// HasTestSubType returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasTestSubType() bool { + return o != nil && o.TestSubType != nil +} + +// SetTestSubType gets a reference to the given SyntheticsTestSubType and assigns it to the TestSubType field. +func (o *SyntheticsTestResultSummaryAttributes) SetTestSubType(v SyntheticsTestSubType) { + o.TestSubType = &v +} + +// GetTestType returns the TestType field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryAttributes) GetTestType() SyntheticsTestType { + if o == nil || o.TestType == nil { + var ret SyntheticsTestType + return ret + } + return *o.TestType +} + +// GetTestTypeOk returns a tuple with the TestType field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryAttributes) GetTestTypeOk() (*SyntheticsTestType, bool) { + if o == nil || o.TestType == nil { + return nil, false + } + return o.TestType, true +} + +// HasTestType returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryAttributes) HasTestType() bool { + return o != nil && o.TestType != nil +} + +// SetTestType gets a reference to the given SyntheticsTestType and assigns it to the TestType field. +func (o *SyntheticsTestResultSummaryAttributes) SetTestType(v SyntheticsTestType) { + o.TestType = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultSummaryAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Device != nil { + toSerialize["device"] = o.Device + } + if o.ExecutionInfo != nil { + toSerialize["execution_info"] = o.ExecutionInfo + } + if o.FinishedAt != nil { + toSerialize["finished_at"] = o.FinishedAt + } + if o.Location != nil { + toSerialize["location"] = o.Location + } + if o.RunType != nil { + toSerialize["run_type"] = o.RunType + } + if o.StartedAt != nil { + toSerialize["started_at"] = o.StartedAt + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.StepsInfo != nil { + toSerialize["steps_info"] = o.StepsInfo + } + if o.TestSubType != nil { + toSerialize["test_sub_type"] = o.TestSubType + } + if o.TestType != nil { + toSerialize["test_type"] = o.TestType + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultSummaryAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Device *SyntheticsTestResultDevice `json:"device,omitempty"` + ExecutionInfo *SyntheticsTestResultExecutionInfo `json:"execution_info,omitempty"` + FinishedAt *int64 `json:"finished_at,omitempty"` + Location *SyntheticsTestResultLocation `json:"location,omitempty"` + RunType *SyntheticsTestResultRunType `json:"run_type,omitempty"` + StartedAt *int64 `json:"started_at,omitempty"` + Status *SyntheticsTestResultStatus `json:"status,omitempty"` + StepsInfo *SyntheticsTestResultStepsInfo `json:"steps_info,omitempty"` + TestSubType *SyntheticsTestSubType `json:"test_sub_type,omitempty"` + TestType *SyntheticsTestType `json:"test_type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"device", "execution_info", "finished_at", "location", "run_type", "started_at", "status", "steps_info", "test_sub_type", "test_type"}) + } else { + return err + } + + hasInvalidField := false + if all.Device != nil && all.Device.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Device = all.Device + if all.ExecutionInfo != nil && all.ExecutionInfo.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.ExecutionInfo = all.ExecutionInfo + o.FinishedAt = all.FinishedAt + if all.Location != nil && all.Location.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Location = all.Location + if all.RunType != nil && !all.RunType.IsValid() { + hasInvalidField = true + } else { + o.RunType = all.RunType + } + o.StartedAt = all.StartedAt + if all.Status != nil && !all.Status.IsValid() { + hasInvalidField = true + } else { + o.Status = all.Status + } + if all.StepsInfo != nil && all.StepsInfo.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.StepsInfo = all.StepsInfo + if all.TestSubType != nil && !all.TestSubType.IsValid() { + hasInvalidField = true + } else { + o.TestSubType = all.TestSubType + } + if all.TestType != nil && !all.TestType.IsValid() { + hasInvalidField = true + } else { + o.TestType = all.TestType + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_summary_data.go b/api/datadogV2/model_synthetics_test_result_summary_data.go new file mode 100644 index 00000000000..6ece77871a3 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_summary_data.go @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultSummaryData Wrapper object for a Synthetic test result summary. +type SyntheticsTestResultSummaryData struct { + // Attributes of a Synthetic test result summary. + Attributes *SyntheticsTestResultSummaryAttributes `json:"attributes,omitempty"` + // The result ID. + Id *string `json:"id,omitempty"` + // Relationships for a Synthetic test result. + Relationships *SyntheticsTestResultRelationships `json:"relationships,omitempty"` + // Type of the Synthetic test result summary resource, `result_summary`. + Type *SyntheticsTestResultSummaryType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultSummaryData instantiates a new SyntheticsTestResultSummaryData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultSummaryData() *SyntheticsTestResultSummaryData { + this := SyntheticsTestResultSummaryData{} + var typeVar SyntheticsTestResultSummaryType = SYNTHETICSTESTRESULTSUMMARYTYPE_RESULT_SUMMARY + this.Type = &typeVar + return &this +} + +// NewSyntheticsTestResultSummaryDataWithDefaults instantiates a new SyntheticsTestResultSummaryData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultSummaryDataWithDefaults() *SyntheticsTestResultSummaryData { + this := SyntheticsTestResultSummaryData{} + var typeVar SyntheticsTestResultSummaryType = SYNTHETICSTESTRESULTSUMMARYTYPE_RESULT_SUMMARY + this.Type = &typeVar + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryData) GetAttributes() SyntheticsTestResultSummaryAttributes { + if o == nil || o.Attributes == nil { + var ret SyntheticsTestResultSummaryAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryData) GetAttributesOk() (*SyntheticsTestResultSummaryAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given SyntheticsTestResultSummaryAttributes and assigns it to the Attributes field. +func (o *SyntheticsTestResultSummaryData) SetAttributes(v SyntheticsTestResultSummaryAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultSummaryData) SetId(v string) { + o.Id = &v +} + +// GetRelationships returns the Relationships field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryData) GetRelationships() SyntheticsTestResultRelationships { + if o == nil || o.Relationships == nil { + var ret SyntheticsTestResultRelationships + return ret + } + return *o.Relationships +} + +// GetRelationshipsOk returns a tuple with the Relationships field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryData) GetRelationshipsOk() (*SyntheticsTestResultRelationships, bool) { + if o == nil || o.Relationships == nil { + return nil, false + } + return o.Relationships, true +} + +// HasRelationships returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryData) HasRelationships() bool { + return o != nil && o.Relationships != nil +} + +// SetRelationships gets a reference to the given SyntheticsTestResultRelationships and assigns it to the Relationships field. +func (o *SyntheticsTestResultSummaryData) SetRelationships(v SyntheticsTestResultRelationships) { + o.Relationships = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultSummaryData) GetType() SyntheticsTestResultSummaryType { + if o == nil || o.Type == nil { + var ret SyntheticsTestResultSummaryType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultSummaryData) GetTypeOk() (*SyntheticsTestResultSummaryType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultSummaryData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given SyntheticsTestResultSummaryType and assigns it to the Type field. +func (o *SyntheticsTestResultSummaryData) SetType(v SyntheticsTestResultSummaryType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultSummaryData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Relationships != nil { + toSerialize["relationships"] = o.Relationships + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultSummaryData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *SyntheticsTestResultSummaryAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Relationships *SyntheticsTestResultRelationships `json:"relationships,omitempty"` + Type *SyntheticsTestResultSummaryType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "relationships", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Relationships != nil && all.Relationships.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Relationships = all.Relationships + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_summary_type.go b/api/datadogV2/model_synthetics_test_result_summary_type.go new file mode 100644 index 00000000000..7b0898d24a2 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_summary_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultSummaryType Type of the Synthetic test result summary resource, `result_summary`. +type SyntheticsTestResultSummaryType string + +// List of SyntheticsTestResultSummaryType. +const ( + SYNTHETICSTESTRESULTSUMMARYTYPE_RESULT_SUMMARY SyntheticsTestResultSummaryType = "result_summary" +) + +var allowedSyntheticsTestResultSummaryTypeEnumValues = []SyntheticsTestResultSummaryType{ + SYNTHETICSTESTRESULTSUMMARYTYPE_RESULT_SUMMARY, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestResultSummaryType) GetAllowedValues() []SyntheticsTestResultSummaryType { + return allowedSyntheticsTestResultSummaryTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestResultSummaryType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestResultSummaryType(value) + return nil +} + +// NewSyntheticsTestResultSummaryTypeFromValue returns a pointer to a valid SyntheticsTestResultSummaryType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestResultSummaryTypeFromValue(v string) (*SyntheticsTestResultSummaryType, error) { + ev := SyntheticsTestResultSummaryType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestResultSummaryType: valid values are %v", v, allowedSyntheticsTestResultSummaryTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestResultSummaryType) IsValid() bool { + for _, existing := range allowedSyntheticsTestResultSummaryTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestResultSummaryType value. +func (v SyntheticsTestResultSummaryType) Ptr() *SyntheticsTestResultSummaryType { + return &v +} diff --git a/api/datadogV2/model_synthetics_test_result_tab.go b/api/datadogV2/model_synthetics_test_result_tab.go new file mode 100644 index 00000000000..c59601d07d5 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_tab.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultTab Information about a browser tab involved in a step. +type SyntheticsTestResultTab struct { + // Whether the tab was focused during the step. + Focused *bool `json:"focused,omitempty"` + // Title of the tab. + Title *string `json:"title,omitempty"` + // URL loaded in the tab. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultTab instantiates a new SyntheticsTestResultTab object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultTab() *SyntheticsTestResultTab { + this := SyntheticsTestResultTab{} + return &this +} + +// NewSyntheticsTestResultTabWithDefaults instantiates a new SyntheticsTestResultTab object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultTabWithDefaults() *SyntheticsTestResultTab { + this := SyntheticsTestResultTab{} + return &this +} + +// GetFocused returns the Focused field value if set, zero value otherwise. +func (o *SyntheticsTestResultTab) GetFocused() bool { + if o == nil || o.Focused == nil { + var ret bool + return ret + } + return *o.Focused +} + +// GetFocusedOk returns a tuple with the Focused field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTab) GetFocusedOk() (*bool, bool) { + if o == nil || o.Focused == nil { + return nil, false + } + return o.Focused, true +} + +// HasFocused returns a boolean if a field has been set. +func (o *SyntheticsTestResultTab) HasFocused() bool { + return o != nil && o.Focused != nil +} + +// SetFocused gets a reference to the given bool and assigns it to the Focused field. +func (o *SyntheticsTestResultTab) SetFocused(v bool) { + o.Focused = &v +} + +// GetTitle returns the Title field value if set, zero value otherwise. +func (o *SyntheticsTestResultTab) GetTitle() string { + if o == nil || o.Title == nil { + var ret string + return ret + } + return *o.Title +} + +// GetTitleOk returns a tuple with the Title field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTab) GetTitleOk() (*string, bool) { + if o == nil || o.Title == nil { + return nil, false + } + return o.Title, true +} + +// HasTitle returns a boolean if a field has been set. +func (o *SyntheticsTestResultTab) HasTitle() bool { + return o != nil && o.Title != nil +} + +// SetTitle gets a reference to the given string and assigns it to the Title field. +func (o *SyntheticsTestResultTab) SetTitle(v string) { + o.Title = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultTab) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTab) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultTab) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultTab) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultTab) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Focused != nil { + toSerialize["focused"] = o.Focused + } + if o.Title != nil { + toSerialize["title"] = o.Title + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultTab) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Focused *bool `json:"focused,omitempty"` + Title *string `json:"title,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"focused", "title", "url"}) + } else { + return err + } + o.Focused = all.Focused + o.Title = all.Title + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_fast_test_result_device.go b/api/datadogV2/model_synthetics_test_result_trace.go similarity index 55% rename from api/datadogV2/model_synthetics_fast_test_result_device.go rename to api/datadogV2/model_synthetics_test_result_trace.go index 9d3009a274c..f2456430b5f 100644 --- a/api/datadogV2/model_synthetics_fast_test_result_device.go +++ b/api/datadogV2/model_synthetics_test_result_trace.go @@ -8,36 +8,36 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SyntheticsFastTestResultDevice Device information for browser-based fast tests. -type SyntheticsFastTestResultDevice struct { - // Device identifier. +// SyntheticsTestResultTrace Trace identifiers associated with a Synthetic test result. +type SyntheticsTestResultTrace struct { + // Datadog APM trace identifier. Id *string `json:"id,omitempty"` - // Display name of the device. - Name *string `json:"name,omitempty"` + // OpenTelemetry trace identifier. + OtelId *string `json:"otel_id,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` } -// NewSyntheticsFastTestResultDevice instantiates a new SyntheticsFastTestResultDevice object. +// NewSyntheticsTestResultTrace instantiates a new SyntheticsTestResultTrace object. // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewSyntheticsFastTestResultDevice() *SyntheticsFastTestResultDevice { - this := SyntheticsFastTestResultDevice{} +func NewSyntheticsTestResultTrace() *SyntheticsTestResultTrace { + this := SyntheticsTestResultTrace{} return &this } -// NewSyntheticsFastTestResultDeviceWithDefaults instantiates a new SyntheticsFastTestResultDevice object. +// NewSyntheticsTestResultTraceWithDefaults instantiates a new SyntheticsTestResultTrace object. // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set. -func NewSyntheticsFastTestResultDeviceWithDefaults() *SyntheticsFastTestResultDevice { - this := SyntheticsFastTestResultDevice{} +func NewSyntheticsTestResultTraceWithDefaults() *SyntheticsTestResultTrace { + this := SyntheticsTestResultTrace{} return &this } // GetId returns the Id field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDevice) GetId() string { +func (o *SyntheticsTestResultTrace) GetId() string { if o == nil || o.Id == nil { var ret string return ret @@ -47,7 +47,7 @@ func (o *SyntheticsFastTestResultDevice) GetId() string { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDevice) GetIdOk() (*string, bool) { +func (o *SyntheticsTestResultTrace) GetIdOk() (*string, bool) { if o == nil || o.Id == nil { return nil, false } @@ -55,45 +55,45 @@ func (o *SyntheticsFastTestResultDevice) GetIdOk() (*string, bool) { } // HasId returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultDevice) HasId() bool { +func (o *SyntheticsTestResultTrace) HasId() bool { return o != nil && o.Id != nil } // SetId gets a reference to the given string and assigns it to the Id field. -func (o *SyntheticsFastTestResultDevice) SetId(v string) { +func (o *SyntheticsTestResultTrace) SetId(v string) { o.Id = &v } -// GetName returns the Name field value if set, zero value otherwise. -func (o *SyntheticsFastTestResultDevice) GetName() string { - if o == nil || o.Name == nil { +// GetOtelId returns the OtelId field value if set, zero value otherwise. +func (o *SyntheticsTestResultTrace) GetOtelId() string { + if o == nil || o.OtelId == nil { var ret string return ret } - return *o.Name + return *o.OtelId } -// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// GetOtelIdOk returns a tuple with the OtelId field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsFastTestResultDevice) GetNameOk() (*string, bool) { - if o == nil || o.Name == nil { +func (o *SyntheticsTestResultTrace) GetOtelIdOk() (*string, bool) { + if o == nil || o.OtelId == nil { return nil, false } - return o.Name, true + return o.OtelId, true } -// HasName returns a boolean if a field has been set. -func (o *SyntheticsFastTestResultDevice) HasName() bool { - return o != nil && o.Name != nil +// HasOtelId returns a boolean if a field has been set. +func (o *SyntheticsTestResultTrace) HasOtelId() bool { + return o != nil && o.OtelId != nil } -// SetName gets a reference to the given string and assigns it to the Name field. -func (o *SyntheticsFastTestResultDevice) SetName(v string) { - o.Name = &v +// SetOtelId gets a reference to the given string and assigns it to the OtelId field. +func (o *SyntheticsTestResultTrace) SetOtelId(v string) { + o.OtelId = &v } // MarshalJSON serializes the struct using spec logic. -func (o SyntheticsFastTestResultDevice) MarshalJSON() ([]byte, error) { +func (o SyntheticsTestResultTrace) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) @@ -101,8 +101,8 @@ func (o SyntheticsFastTestResultDevice) MarshalJSON() ([]byte, error) { if o.Id != nil { toSerialize["id"] = o.Id } - if o.Name != nil { - toSerialize["name"] = o.Name + if o.OtelId != nil { + toSerialize["otel_id"] = o.OtelId } for key, value := range o.AdditionalProperties { @@ -112,22 +112,22 @@ func (o SyntheticsFastTestResultDevice) MarshalJSON() ([]byte, error) { } // UnmarshalJSON deserializes the given payload. -func (o *SyntheticsFastTestResultDevice) UnmarshalJSON(bytes []byte) (err error) { +func (o *SyntheticsTestResultTrace) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` + Id *string `json:"id,omitempty"` + OtelId *string `json:"otel_id,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"id", "name"}) + datadog.DeleteKeys(additionalProperties, &[]string{"id", "otel_id"}) } else { return err } o.Id = all.Id - o.Name = all.Name + o.OtelId = all.OtelId if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_synthetics_test_result_traceroute_hop.go b/api/datadogV2/model_synthetics_test_result_traceroute_hop.go new file mode 100644 index 00000000000..656c877fe68 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_traceroute_hop.go @@ -0,0 +1,356 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultTracerouteHop A network probe result, used for traceroute hops and ping summaries. +type SyntheticsTestResultTracerouteHop struct { + // Target hostname. + Host *string `json:"host,omitempty"` + // Latency statistics for a network probe. + Latency *SyntheticsTestResultNetworkLatency `json:"latency,omitempty"` + // Percentage of probe packets lost. + PacketLossPercentage *float64 `json:"packet_loss_percentage,omitempty"` + // Size of each probe packet in bytes. + PacketSize *int64 `json:"packet_size,omitempty"` + // Number of probe packets received. + PacketsReceived *int64 `json:"packets_received,omitempty"` + // Number of probe packets sent. + PacketsSent *int64 `json:"packets_sent,omitempty"` + // Resolved IP address for the target. + ResolvedIp *string `json:"resolved_ip,omitempty"` + // List of intermediate routers for the traceroute. + Routers []SyntheticsTestResultRouter `json:"routers,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultTracerouteHop instantiates a new SyntheticsTestResultTracerouteHop object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultTracerouteHop() *SyntheticsTestResultTracerouteHop { + this := SyntheticsTestResultTracerouteHop{} + return &this +} + +// NewSyntheticsTestResultTracerouteHopWithDefaults instantiates a new SyntheticsTestResultTracerouteHop object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultTracerouteHopWithDefaults() *SyntheticsTestResultTracerouteHop { + this := SyntheticsTestResultTracerouteHop{} + return &this +} + +// GetHost returns the Host field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetHost() string { + if o == nil || o.Host == nil { + var ret string + return ret + } + return *o.Host +} + +// GetHostOk returns a tuple with the Host field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetHostOk() (*string, bool) { + if o == nil || o.Host == nil { + return nil, false + } + return o.Host, true +} + +// HasHost returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasHost() bool { + return o != nil && o.Host != nil +} + +// SetHost gets a reference to the given string and assigns it to the Host field. +func (o *SyntheticsTestResultTracerouteHop) SetHost(v string) { + o.Host = &v +} + +// GetLatency returns the Latency field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetLatency() SyntheticsTestResultNetworkLatency { + if o == nil || o.Latency == nil { + var ret SyntheticsTestResultNetworkLatency + return ret + } + return *o.Latency +} + +// GetLatencyOk returns a tuple with the Latency field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetLatencyOk() (*SyntheticsTestResultNetworkLatency, bool) { + if o == nil || o.Latency == nil { + return nil, false + } + return o.Latency, true +} + +// HasLatency returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasLatency() bool { + return o != nil && o.Latency != nil +} + +// SetLatency gets a reference to the given SyntheticsTestResultNetworkLatency and assigns it to the Latency field. +func (o *SyntheticsTestResultTracerouteHop) SetLatency(v SyntheticsTestResultNetworkLatency) { + o.Latency = &v +} + +// GetPacketLossPercentage returns the PacketLossPercentage field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetPacketLossPercentage() float64 { + if o == nil || o.PacketLossPercentage == nil { + var ret float64 + return ret + } + return *o.PacketLossPercentage +} + +// GetPacketLossPercentageOk returns a tuple with the PacketLossPercentage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetPacketLossPercentageOk() (*float64, bool) { + if o == nil || o.PacketLossPercentage == nil { + return nil, false + } + return o.PacketLossPercentage, true +} + +// HasPacketLossPercentage returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasPacketLossPercentage() bool { + return o != nil && o.PacketLossPercentage != nil +} + +// SetPacketLossPercentage gets a reference to the given float64 and assigns it to the PacketLossPercentage field. +func (o *SyntheticsTestResultTracerouteHop) SetPacketLossPercentage(v float64) { + o.PacketLossPercentage = &v +} + +// GetPacketSize returns the PacketSize field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetPacketSize() int64 { + if o == nil || o.PacketSize == nil { + var ret int64 + return ret + } + return *o.PacketSize +} + +// GetPacketSizeOk returns a tuple with the PacketSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetPacketSizeOk() (*int64, bool) { + if o == nil || o.PacketSize == nil { + return nil, false + } + return o.PacketSize, true +} + +// HasPacketSize returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasPacketSize() bool { + return o != nil && o.PacketSize != nil +} + +// SetPacketSize gets a reference to the given int64 and assigns it to the PacketSize field. +func (o *SyntheticsTestResultTracerouteHop) SetPacketSize(v int64) { + o.PacketSize = &v +} + +// GetPacketsReceived returns the PacketsReceived field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetPacketsReceived() int64 { + if o == nil || o.PacketsReceived == nil { + var ret int64 + return ret + } + return *o.PacketsReceived +} + +// GetPacketsReceivedOk returns a tuple with the PacketsReceived field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetPacketsReceivedOk() (*int64, bool) { + if o == nil || o.PacketsReceived == nil { + return nil, false + } + return o.PacketsReceived, true +} + +// HasPacketsReceived returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasPacketsReceived() bool { + return o != nil && o.PacketsReceived != nil +} + +// SetPacketsReceived gets a reference to the given int64 and assigns it to the PacketsReceived field. +func (o *SyntheticsTestResultTracerouteHop) SetPacketsReceived(v int64) { + o.PacketsReceived = &v +} + +// GetPacketsSent returns the PacketsSent field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetPacketsSent() int64 { + if o == nil || o.PacketsSent == nil { + var ret int64 + return ret + } + return *o.PacketsSent +} + +// GetPacketsSentOk returns a tuple with the PacketsSent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetPacketsSentOk() (*int64, bool) { + if o == nil || o.PacketsSent == nil { + return nil, false + } + return o.PacketsSent, true +} + +// HasPacketsSent returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasPacketsSent() bool { + return o != nil && o.PacketsSent != nil +} + +// SetPacketsSent gets a reference to the given int64 and assigns it to the PacketsSent field. +func (o *SyntheticsTestResultTracerouteHop) SetPacketsSent(v int64) { + o.PacketsSent = &v +} + +// GetResolvedIp returns the ResolvedIp field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetResolvedIp() string { + if o == nil || o.ResolvedIp == nil { + var ret string + return ret + } + return *o.ResolvedIp +} + +// GetResolvedIpOk returns a tuple with the ResolvedIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetResolvedIpOk() (*string, bool) { + if o == nil || o.ResolvedIp == nil { + return nil, false + } + return o.ResolvedIp, true +} + +// HasResolvedIp returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasResolvedIp() bool { + return o != nil && o.ResolvedIp != nil +} + +// SetResolvedIp gets a reference to the given string and assigns it to the ResolvedIp field. +func (o *SyntheticsTestResultTracerouteHop) SetResolvedIp(v string) { + o.ResolvedIp = &v +} + +// GetRouters returns the Routers field value if set, zero value otherwise. +func (o *SyntheticsTestResultTracerouteHop) GetRouters() []SyntheticsTestResultRouter { + if o == nil || o.Routers == nil { + var ret []SyntheticsTestResultRouter + return ret + } + return o.Routers +} + +// GetRoutersOk returns a tuple with the Routers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTracerouteHop) GetRoutersOk() (*[]SyntheticsTestResultRouter, bool) { + if o == nil || o.Routers == nil { + return nil, false + } + return &o.Routers, true +} + +// HasRouters returns a boolean if a field has been set. +func (o *SyntheticsTestResultTracerouteHop) HasRouters() bool { + return o != nil && o.Routers != nil +} + +// SetRouters gets a reference to the given []SyntheticsTestResultRouter and assigns it to the Routers field. +func (o *SyntheticsTestResultTracerouteHop) SetRouters(v []SyntheticsTestResultRouter) { + o.Routers = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultTracerouteHop) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Host != nil { + toSerialize["host"] = o.Host + } + if o.Latency != nil { + toSerialize["latency"] = o.Latency + } + if o.PacketLossPercentage != nil { + toSerialize["packet_loss_percentage"] = o.PacketLossPercentage + } + if o.PacketSize != nil { + toSerialize["packet_size"] = o.PacketSize + } + if o.PacketsReceived != nil { + toSerialize["packets_received"] = o.PacketsReceived + } + if o.PacketsSent != nil { + toSerialize["packets_sent"] = o.PacketsSent + } + if o.ResolvedIp != nil { + toSerialize["resolved_ip"] = o.ResolvedIp + } + if o.Routers != nil { + toSerialize["routers"] = o.Routers + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultTracerouteHop) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Host *string `json:"host,omitempty"` + Latency *SyntheticsTestResultNetworkLatency `json:"latency,omitempty"` + PacketLossPercentage *float64 `json:"packet_loss_percentage,omitempty"` + PacketSize *int64 `json:"packet_size,omitempty"` + PacketsReceived *int64 `json:"packets_received,omitempty"` + PacketsSent *int64 `json:"packets_sent,omitempty"` + ResolvedIp *string `json:"resolved_ip,omitempty"` + Routers []SyntheticsTestResultRouter `json:"routers,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"host", "latency", "packet_loss_percentage", "packet_size", "packets_received", "packets_sent", "resolved_ip", "routers"}) + } else { + return err + } + + hasInvalidField := false + o.Host = all.Host + if all.Latency != nil && all.Latency.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Latency = all.Latency + o.PacketLossPercentage = all.PacketLossPercentage + o.PacketSize = all.PacketSize + o.PacketsReceived = all.PacketsReceived + o.PacketsSent = all.PacketsSent + o.ResolvedIp = all.ResolvedIp + o.Routers = all.Routers + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_turn.go b/api/datadogV2/model_synthetics_test_result_turn.go new file mode 100644 index 00000000000..b1d5baa661c --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_turn.go @@ -0,0 +1,321 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultTurn A turn in a goal-based browser test, grouping steps and reasoning. +type SyntheticsTestResultTurn struct { + // Storage bucket keys for artifacts produced during a step or test. + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + // Name of the turn. + Name *string `json:"name,omitempty"` + // Agent reasoning produced for this turn. + Reasoning *string `json:"reasoning,omitempty"` + // Status of the turn (for example, `passed`, `failed`). + Status *string `json:"status,omitempty"` + // Steps executed during the turn. + Steps []SyntheticsTestResultTurnStep `json:"steps,omitempty"` + // Unix timestamp (ms) of when the turn finished. + TurnFinishedAt *int64 `json:"turn_finished_at,omitempty"` + // Unix timestamp (ms) of when the turn started. + TurnStartedAt *int64 `json:"turn_started_at,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultTurn instantiates a new SyntheticsTestResultTurn object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultTurn() *SyntheticsTestResultTurn { + this := SyntheticsTestResultTurn{} + return &this +} + +// NewSyntheticsTestResultTurnWithDefaults instantiates a new SyntheticsTestResultTurn object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultTurnWithDefaults() *SyntheticsTestResultTurn { + this := SyntheticsTestResultTurn{} + return &this +} + +// GetBucketKeys returns the BucketKeys field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetBucketKeys() SyntheticsTestResultBucketKeys { + if o == nil || o.BucketKeys == nil { + var ret SyntheticsTestResultBucketKeys + return ret + } + return *o.BucketKeys +} + +// GetBucketKeysOk returns a tuple with the BucketKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetBucketKeysOk() (*SyntheticsTestResultBucketKeys, bool) { + if o == nil || o.BucketKeys == nil { + return nil, false + } + return o.BucketKeys, true +} + +// HasBucketKeys returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasBucketKeys() bool { + return o != nil && o.BucketKeys != nil +} + +// SetBucketKeys gets a reference to the given SyntheticsTestResultBucketKeys and assigns it to the BucketKeys field. +func (o *SyntheticsTestResultTurn) SetBucketKeys(v SyntheticsTestResultBucketKeys) { + o.BucketKeys = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultTurn) SetName(v string) { + o.Name = &v +} + +// GetReasoning returns the Reasoning field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetReasoning() string { + if o == nil || o.Reasoning == nil { + var ret string + return ret + } + return *o.Reasoning +} + +// GetReasoningOk returns a tuple with the Reasoning field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetReasoningOk() (*string, bool) { + if o == nil || o.Reasoning == nil { + return nil, false + } + return o.Reasoning, true +} + +// HasReasoning returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasReasoning() bool { + return o != nil && o.Reasoning != nil +} + +// SetReasoning gets a reference to the given string and assigns it to the Reasoning field. +func (o *SyntheticsTestResultTurn) SetReasoning(v string) { + o.Reasoning = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetStatusOk() (*string, bool) { + if o == nil || o.Status == nil { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasStatus() bool { + return o != nil && o.Status != nil +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *SyntheticsTestResultTurn) SetStatus(v string) { + o.Status = &v +} + +// GetSteps returns the Steps field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetSteps() []SyntheticsTestResultTurnStep { + if o == nil || o.Steps == nil { + var ret []SyntheticsTestResultTurnStep + return ret + } + return o.Steps +} + +// GetStepsOk returns a tuple with the Steps field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetStepsOk() (*[]SyntheticsTestResultTurnStep, bool) { + if o == nil || o.Steps == nil { + return nil, false + } + return &o.Steps, true +} + +// HasSteps returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasSteps() bool { + return o != nil && o.Steps != nil +} + +// SetSteps gets a reference to the given []SyntheticsTestResultTurnStep and assigns it to the Steps field. +func (o *SyntheticsTestResultTurn) SetSteps(v []SyntheticsTestResultTurnStep) { + o.Steps = v +} + +// GetTurnFinishedAt returns the TurnFinishedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetTurnFinishedAt() int64 { + if o == nil || o.TurnFinishedAt == nil { + var ret int64 + return ret + } + return *o.TurnFinishedAt +} + +// GetTurnFinishedAtOk returns a tuple with the TurnFinishedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetTurnFinishedAtOk() (*int64, bool) { + if o == nil || o.TurnFinishedAt == nil { + return nil, false + } + return o.TurnFinishedAt, true +} + +// HasTurnFinishedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasTurnFinishedAt() bool { + return o != nil && o.TurnFinishedAt != nil +} + +// SetTurnFinishedAt gets a reference to the given int64 and assigns it to the TurnFinishedAt field. +func (o *SyntheticsTestResultTurn) SetTurnFinishedAt(v int64) { + o.TurnFinishedAt = &v +} + +// GetTurnStartedAt returns the TurnStartedAt field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurn) GetTurnStartedAt() int64 { + if o == nil || o.TurnStartedAt == nil { + var ret int64 + return ret + } + return *o.TurnStartedAt +} + +// GetTurnStartedAtOk returns a tuple with the TurnStartedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurn) GetTurnStartedAtOk() (*int64, bool) { + if o == nil || o.TurnStartedAt == nil { + return nil, false + } + return o.TurnStartedAt, true +} + +// HasTurnStartedAt returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurn) HasTurnStartedAt() bool { + return o != nil && o.TurnStartedAt != nil +} + +// SetTurnStartedAt gets a reference to the given int64 and assigns it to the TurnStartedAt field. +func (o *SyntheticsTestResultTurn) SetTurnStartedAt(v int64) { + o.TurnStartedAt = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultTurn) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.BucketKeys != nil { + toSerialize["bucket_keys"] = o.BucketKeys + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Reasoning != nil { + toSerialize["reasoning"] = o.Reasoning + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Steps != nil { + toSerialize["steps"] = o.Steps + } + if o.TurnFinishedAt != nil { + toSerialize["turn_finished_at"] = o.TurnFinishedAt + } + if o.TurnStartedAt != nil { + toSerialize["turn_started_at"] = o.TurnStartedAt + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultTurn) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + Name *string `json:"name,omitempty"` + Reasoning *string `json:"reasoning,omitempty"` + Status *string `json:"status,omitempty"` + Steps []SyntheticsTestResultTurnStep `json:"steps,omitempty"` + TurnFinishedAt *int64 `json:"turn_finished_at,omitempty"` + TurnStartedAt *int64 `json:"turn_started_at,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"bucket_keys", "name", "reasoning", "status", "steps", "turn_finished_at", "turn_started_at"}) + } else { + return err + } + + hasInvalidField := false + if all.BucketKeys != nil && all.BucketKeys.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BucketKeys = all.BucketKeys + o.Name = all.Name + o.Reasoning = all.Reasoning + o.Status = all.Status + o.Steps = all.Steps + o.TurnFinishedAt = all.TurnFinishedAt + o.TurnStartedAt = all.TurnStartedAt + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_turn_step.go b/api/datadogV2/model_synthetics_test_result_turn_step.go new file mode 100644 index 00000000000..48fc81d6df7 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_turn_step.go @@ -0,0 +1,146 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultTurnStep A step executed during a goal-based browser test turn. +type SyntheticsTestResultTurnStep struct { + // Storage bucket keys for artifacts produced during a step or test. + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + // Browser step configuration for this turn step. + Config map[string]interface{} `json:"config,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultTurnStep instantiates a new SyntheticsTestResultTurnStep object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultTurnStep() *SyntheticsTestResultTurnStep { + this := SyntheticsTestResultTurnStep{} + return &this +} + +// NewSyntheticsTestResultTurnStepWithDefaults instantiates a new SyntheticsTestResultTurnStep object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultTurnStepWithDefaults() *SyntheticsTestResultTurnStep { + this := SyntheticsTestResultTurnStep{} + return &this +} + +// GetBucketKeys returns the BucketKeys field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurnStep) GetBucketKeys() SyntheticsTestResultBucketKeys { + if o == nil || o.BucketKeys == nil { + var ret SyntheticsTestResultBucketKeys + return ret + } + return *o.BucketKeys +} + +// GetBucketKeysOk returns a tuple with the BucketKeys field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurnStep) GetBucketKeysOk() (*SyntheticsTestResultBucketKeys, bool) { + if o == nil || o.BucketKeys == nil { + return nil, false + } + return o.BucketKeys, true +} + +// HasBucketKeys returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurnStep) HasBucketKeys() bool { + return o != nil && o.BucketKeys != nil +} + +// SetBucketKeys gets a reference to the given SyntheticsTestResultBucketKeys and assigns it to the BucketKeys field. +func (o *SyntheticsTestResultTurnStep) SetBucketKeys(v SyntheticsTestResultBucketKeys) { + o.BucketKeys = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *SyntheticsTestResultTurnStep) GetConfig() map[string]interface{} { + if o == nil || o.Config == nil { + var ret map[string]interface{} + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultTurnStep) GetConfigOk() (*map[string]interface{}, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *SyntheticsTestResultTurnStep) HasConfig() bool { + return o != nil && o.Config != nil +} + +// SetConfig gets a reference to the given map[string]interface{} and assigns it to the Config field. +func (o *SyntheticsTestResultTurnStep) SetConfig(v map[string]interface{}) { + o.Config = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultTurnStep) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.BucketKeys != nil { + toSerialize["bucket_keys"] = o.BucketKeys + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultTurnStep) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + BucketKeys *SyntheticsTestResultBucketKeys `json:"bucket_keys,omitempty"` + Config map[string]interface{} `json:"config,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"bucket_keys", "config"}) + } else { + return err + } + + hasInvalidField := false + if all.BucketKeys != nil && all.BucketKeys.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.BucketKeys = all.BucketKeys + o.Config = all.Config + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_type.go b/api/datadogV2/model_synthetics_test_result_type.go new file mode 100644 index 00000000000..575c9145a39 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_type.go @@ -0,0 +1,64 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultType Type of the Synthetic test result resource, `result`. +type SyntheticsTestResultType string + +// List of SyntheticsTestResultType. +const ( + SYNTHETICSTESTRESULTTYPE_RESULT SyntheticsTestResultType = "result" +) + +var allowedSyntheticsTestResultTypeEnumValues = []SyntheticsTestResultType{ + SYNTHETICSTESTRESULTTYPE_RESULT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestResultType) GetAllowedValues() []SyntheticsTestResultType { + return allowedSyntheticsTestResultTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestResultType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestResultType(value) + return nil +} + +// NewSyntheticsTestResultTypeFromValue returns a pointer to a valid SyntheticsTestResultType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestResultTypeFromValue(v string) (*SyntheticsTestResultType, error) { + ev := SyntheticsTestResultType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestResultType: valid values are %v", v, allowedSyntheticsTestResultTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestResultType) IsValid() bool { + for _, existing := range allowedSyntheticsTestResultTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestResultType value. +func (v SyntheticsTestResultType) Ptr() *SyntheticsTestResultType { + return &v +} diff --git a/api/datadogV2/model_synthetics_test_result_variable.go b/api/datadogV2/model_synthetics_test_result_variable.go new file mode 100644 index 00000000000..8815b44b798 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_variable.go @@ -0,0 +1,417 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultVariable A variable used or extracted during a test. +type SyntheticsTestResultVariable struct { + // Error encountered when evaluating the variable. + Err *string `json:"err,omitempty"` + // Human-readable error message for variable evaluation. + ErrorMessage *string `json:"error_message,omitempty"` + // Example value for the variable. + Example *string `json:"example,omitempty"` + // Variable identifier. + Id *string `json:"id,omitempty"` + // Variable name. + Name *string `json:"name,omitempty"` + // Pattern used to extract the variable. + Pattern *string `json:"pattern,omitempty"` + // Whether the variable holds a secure value. + Secure *bool `json:"secure,omitempty"` + // Variable type. + Type *string `json:"type,omitempty"` + // Evaluated value of the variable. + Val *string `json:"val,omitempty"` + // Current value of the variable. + Value *string `json:"value,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultVariable instantiates a new SyntheticsTestResultVariable object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultVariable() *SyntheticsTestResultVariable { + this := SyntheticsTestResultVariable{} + return &this +} + +// NewSyntheticsTestResultVariableWithDefaults instantiates a new SyntheticsTestResultVariable object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultVariableWithDefaults() *SyntheticsTestResultVariable { + this := SyntheticsTestResultVariable{} + return &this +} + +// GetErr returns the Err field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetErr() string { + if o == nil || o.Err == nil { + var ret string + return ret + } + return *o.Err +} + +// GetErrOk returns a tuple with the Err field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetErrOk() (*string, bool) { + if o == nil || o.Err == nil { + return nil, false + } + return o.Err, true +} + +// HasErr returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasErr() bool { + return o != nil && o.Err != nil +} + +// SetErr gets a reference to the given string and assigns it to the Err field. +func (o *SyntheticsTestResultVariable) SetErr(v string) { + o.Err = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetErrorMessage() string { + if o == nil || o.ErrorMessage == nil { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetErrorMessageOk() (*string, bool) { + if o == nil || o.ErrorMessage == nil { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasErrorMessage() bool { + return o != nil && o.ErrorMessage != nil +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *SyntheticsTestResultVariable) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetExample returns the Example field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetExample() string { + if o == nil || o.Example == nil { + var ret string + return ret + } + return *o.Example +} + +// GetExampleOk returns a tuple with the Example field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetExampleOk() (*string, bool) { + if o == nil || o.Example == nil { + return nil, false + } + return o.Example, true +} + +// HasExample returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasExample() bool { + return o != nil && o.Example != nil +} + +// SetExample gets a reference to the given string and assigns it to the Example field. +func (o *SyntheticsTestResultVariable) SetExample(v string) { + o.Example = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SyntheticsTestResultVariable) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *SyntheticsTestResultVariable) SetName(v string) { + o.Name = &v +} + +// GetPattern returns the Pattern field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetPattern() string { + if o == nil || o.Pattern == nil { + var ret string + return ret + } + return *o.Pattern +} + +// GetPatternOk returns a tuple with the Pattern field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetPatternOk() (*string, bool) { + if o == nil || o.Pattern == nil { + return nil, false + } + return o.Pattern, true +} + +// HasPattern returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasPattern() bool { + return o != nil && o.Pattern != nil +} + +// SetPattern gets a reference to the given string and assigns it to the Pattern field. +func (o *SyntheticsTestResultVariable) SetPattern(v string) { + o.Pattern = &v +} + +// GetSecure returns the Secure field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetSecure() bool { + if o == nil || o.Secure == nil { + var ret bool + return ret + } + return *o.Secure +} + +// GetSecureOk returns a tuple with the Secure field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetSecureOk() (*bool, bool) { + if o == nil || o.Secure == nil { + return nil, false + } + return o.Secure, true +} + +// HasSecure returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasSecure() bool { + return o != nil && o.Secure != nil +} + +// SetSecure gets a reference to the given bool and assigns it to the Secure field. +func (o *SyntheticsTestResultVariable) SetSecure(v bool) { + o.Secure = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultVariable) SetType(v string) { + o.Type = &v +} + +// GetVal returns the Val field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetVal() string { + if o == nil || o.Val == nil { + var ret string + return ret + } + return *o.Val +} + +// GetValOk returns a tuple with the Val field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetValOk() (*string, bool) { + if o == nil || o.Val == nil { + return nil, false + } + return o.Val, true +} + +// HasVal returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasVal() bool { + return o != nil && o.Val != nil +} + +// SetVal gets a reference to the given string and assigns it to the Val field. +func (o *SyntheticsTestResultVariable) SetVal(v string) { + o.Val = &v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariable) GetValue() string { + if o == nil || o.Value == nil { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariable) GetValueOk() (*string, bool) { + if o == nil || o.Value == nil { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariable) HasValue() bool { + return o != nil && o.Value != nil +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *SyntheticsTestResultVariable) SetValue(v string) { + o.Value = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultVariable) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Err != nil { + toSerialize["err"] = o.Err + } + if o.ErrorMessage != nil { + toSerialize["error_message"] = o.ErrorMessage + } + if o.Example != nil { + toSerialize["example"] = o.Example + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Pattern != nil { + toSerialize["pattern"] = o.Pattern + } + if o.Secure != nil { + toSerialize["secure"] = o.Secure + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Val != nil { + toSerialize["val"] = o.Val + } + if o.Value != nil { + toSerialize["value"] = o.Value + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultVariable) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Err *string `json:"err,omitempty"` + ErrorMessage *string `json:"error_message,omitempty"` + Example *string `json:"example,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Pattern *string `json:"pattern,omitempty"` + Secure *bool `json:"secure,omitempty"` + Type *string `json:"type,omitempty"` + Val *string `json:"val,omitempty"` + Value *string `json:"value,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"err", "error_message", "example", "id", "name", "pattern", "secure", "type", "val", "value"}) + } else { + return err + } + o.Err = all.Err + o.ErrorMessage = all.ErrorMessage + o.Example = all.Example + o.Id = all.Id + o.Name = all.Name + o.Pattern = all.Pattern + o.Secure = all.Secure + o.Type = all.Type + o.Val = all.Val + o.Value = all.Value + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_variables.go b/api/datadogV2/model_synthetics_test_result_variables.go new file mode 100644 index 00000000000..1a4db280218 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_variables.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultVariables Variables captured during a test step. +type SyntheticsTestResultVariables struct { + // Variables defined in the test configuration. + Config []SyntheticsTestResultVariable `json:"config,omitempty"` + // Variables extracted during the test execution. + Extracted []SyntheticsTestResultVariable `json:"extracted,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultVariables instantiates a new SyntheticsTestResultVariables object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultVariables() *SyntheticsTestResultVariables { + this := SyntheticsTestResultVariables{} + return &this +} + +// NewSyntheticsTestResultVariablesWithDefaults instantiates a new SyntheticsTestResultVariables object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultVariablesWithDefaults() *SyntheticsTestResultVariables { + this := SyntheticsTestResultVariables{} + return &this +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariables) GetConfig() []SyntheticsTestResultVariable { + if o == nil || o.Config == nil { + var ret []SyntheticsTestResultVariable + return ret + } + return o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariables) GetConfigOk() (*[]SyntheticsTestResultVariable, bool) { + if o == nil || o.Config == nil { + return nil, false + } + return &o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariables) HasConfig() bool { + return o != nil && o.Config != nil +} + +// SetConfig gets a reference to the given []SyntheticsTestResultVariable and assigns it to the Config field. +func (o *SyntheticsTestResultVariables) SetConfig(v []SyntheticsTestResultVariable) { + o.Config = v +} + +// GetExtracted returns the Extracted field value if set, zero value otherwise. +func (o *SyntheticsTestResultVariables) GetExtracted() []SyntheticsTestResultVariable { + if o == nil || o.Extracted == nil { + var ret []SyntheticsTestResultVariable + return ret + } + return o.Extracted +} + +// GetExtractedOk returns a tuple with the Extracted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVariables) GetExtractedOk() (*[]SyntheticsTestResultVariable, bool) { + if o == nil || o.Extracted == nil { + return nil, false + } + return &o.Extracted, true +} + +// HasExtracted returns a boolean if a field has been set. +func (o *SyntheticsTestResultVariables) HasExtracted() bool { + return o != nil && o.Extracted != nil +} + +// SetExtracted gets a reference to the given []SyntheticsTestResultVariable and assigns it to the Extracted field. +func (o *SyntheticsTestResultVariables) SetExtracted(v []SyntheticsTestResultVariable) { + o.Extracted = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultVariables) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Config != nil { + toSerialize["config"] = o.Config + } + if o.Extracted != nil { + toSerialize["extracted"] = o.Extracted + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultVariables) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Config []SyntheticsTestResultVariable `json:"config,omitempty"` + Extracted []SyntheticsTestResultVariable `json:"extracted,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"config", "extracted"}) + } else { + return err + } + o.Config = all.Config + o.Extracted = all.Extracted + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_vitals_metrics.go b/api/datadogV2/model_synthetics_test_result_vitals_metrics.go new file mode 100644 index 00000000000..51670b223ac --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_vitals_metrics.go @@ -0,0 +1,277 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultVitalsMetrics Web vitals metrics captured during a browser test step. +type SyntheticsTestResultVitalsMetrics struct { + // Cumulative Layout Shift score. + Cls *float64 `json:"cls,omitempty"` + // First Contentful Paint in milliseconds. + Fcp *float64 `json:"fcp,omitempty"` + // Interaction to Next Paint in milliseconds. + Inp *float64 `json:"inp,omitempty"` + // Largest Contentful Paint in milliseconds. + Lcp *float64 `json:"lcp,omitempty"` + // Time To First Byte in milliseconds. + Ttfb *float64 `json:"ttfb,omitempty"` + // URL that produced the metrics. + Url *string `json:"url,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultVitalsMetrics instantiates a new SyntheticsTestResultVitalsMetrics object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultVitalsMetrics() *SyntheticsTestResultVitalsMetrics { + this := SyntheticsTestResultVitalsMetrics{} + return &this +} + +// NewSyntheticsTestResultVitalsMetricsWithDefaults instantiates a new SyntheticsTestResultVitalsMetrics object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultVitalsMetricsWithDefaults() *SyntheticsTestResultVitalsMetrics { + this := SyntheticsTestResultVitalsMetrics{} + return &this +} + +// GetCls returns the Cls field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetCls() float64 { + if o == nil || o.Cls == nil { + var ret float64 + return ret + } + return *o.Cls +} + +// GetClsOk returns a tuple with the Cls field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetClsOk() (*float64, bool) { + if o == nil || o.Cls == nil { + return nil, false + } + return o.Cls, true +} + +// HasCls returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasCls() bool { + return o != nil && o.Cls != nil +} + +// SetCls gets a reference to the given float64 and assigns it to the Cls field. +func (o *SyntheticsTestResultVitalsMetrics) SetCls(v float64) { + o.Cls = &v +} + +// GetFcp returns the Fcp field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetFcp() float64 { + if o == nil || o.Fcp == nil { + var ret float64 + return ret + } + return *o.Fcp +} + +// GetFcpOk returns a tuple with the Fcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetFcpOk() (*float64, bool) { + if o == nil || o.Fcp == nil { + return nil, false + } + return o.Fcp, true +} + +// HasFcp returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasFcp() bool { + return o != nil && o.Fcp != nil +} + +// SetFcp gets a reference to the given float64 and assigns it to the Fcp field. +func (o *SyntheticsTestResultVitalsMetrics) SetFcp(v float64) { + o.Fcp = &v +} + +// GetInp returns the Inp field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetInp() float64 { + if o == nil || o.Inp == nil { + var ret float64 + return ret + } + return *o.Inp +} + +// GetInpOk returns a tuple with the Inp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetInpOk() (*float64, bool) { + if o == nil || o.Inp == nil { + return nil, false + } + return o.Inp, true +} + +// HasInp returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasInp() bool { + return o != nil && o.Inp != nil +} + +// SetInp gets a reference to the given float64 and assigns it to the Inp field. +func (o *SyntheticsTestResultVitalsMetrics) SetInp(v float64) { + o.Inp = &v +} + +// GetLcp returns the Lcp field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetLcp() float64 { + if o == nil || o.Lcp == nil { + var ret float64 + return ret + } + return *o.Lcp +} + +// GetLcpOk returns a tuple with the Lcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetLcpOk() (*float64, bool) { + if o == nil || o.Lcp == nil { + return nil, false + } + return o.Lcp, true +} + +// HasLcp returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasLcp() bool { + return o != nil && o.Lcp != nil +} + +// SetLcp gets a reference to the given float64 and assigns it to the Lcp field. +func (o *SyntheticsTestResultVitalsMetrics) SetLcp(v float64) { + o.Lcp = &v +} + +// GetTtfb returns the Ttfb field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetTtfb() float64 { + if o == nil || o.Ttfb == nil { + var ret float64 + return ret + } + return *o.Ttfb +} + +// GetTtfbOk returns a tuple with the Ttfb field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetTtfbOk() (*float64, bool) { + if o == nil || o.Ttfb == nil { + return nil, false + } + return o.Ttfb, true +} + +// HasTtfb returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasTtfb() bool { + return o != nil && o.Ttfb != nil +} + +// SetTtfb gets a reference to the given float64 and assigns it to the Ttfb field. +func (o *SyntheticsTestResultVitalsMetrics) SetTtfb(v float64) { + o.Ttfb = &v +} + +// GetUrl returns the Url field value if set, zero value otherwise. +func (o *SyntheticsTestResultVitalsMetrics) GetUrl() string { + if o == nil || o.Url == nil { + var ret string + return ret + } + return *o.Url +} + +// GetUrlOk returns a tuple with the Url field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultVitalsMetrics) GetUrlOk() (*string, bool) { + if o == nil || o.Url == nil { + return nil, false + } + return o.Url, true +} + +// HasUrl returns a boolean if a field has been set. +func (o *SyntheticsTestResultVitalsMetrics) HasUrl() bool { + return o != nil && o.Url != nil +} + +// SetUrl gets a reference to the given string and assigns it to the Url field. +func (o *SyntheticsTestResultVitalsMetrics) SetUrl(v string) { + o.Url = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultVitalsMetrics) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Cls != nil { + toSerialize["cls"] = o.Cls + } + if o.Fcp != nil { + toSerialize["fcp"] = o.Fcp + } + if o.Inp != nil { + toSerialize["inp"] = o.Inp + } + if o.Lcp != nil { + toSerialize["lcp"] = o.Lcp + } + if o.Ttfb != nil { + toSerialize["ttfb"] = o.Ttfb + } + if o.Url != nil { + toSerialize["url"] = o.Url + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultVitalsMetrics) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Cls *float64 `json:"cls,omitempty"` + Fcp *float64 `json:"fcp,omitempty"` + Inp *float64 `json:"inp,omitempty"` + Lcp *float64 `json:"lcp,omitempty"` + Ttfb *float64 `json:"ttfb,omitempty"` + Url *string `json:"url,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"cls", "fcp", "inp", "lcp", "ttfb", "url"}) + } else { + return err + } + o.Cls = all.Cls + o.Fcp = all.Fcp + o.Inp = all.Inp + o.Lcp = all.Lcp + o.Ttfb = all.Ttfb + o.Url = all.Url + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_warning.go b/api/datadogV2/model_synthetics_test_result_warning.go new file mode 100644 index 00000000000..e88f8f51055 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_warning.go @@ -0,0 +1,172 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultWarning A warning captured during a browser test step. +type SyntheticsTestResultWarning struct { + // Bounds of elements related to the warning. + ElementBounds []SyntheticsTestResultBounds `json:"element_bounds,omitempty"` + // Warning message. + Message *string `json:"message,omitempty"` + // Type of the warning. + Type *string `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultWarning instantiates a new SyntheticsTestResultWarning object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultWarning() *SyntheticsTestResultWarning { + this := SyntheticsTestResultWarning{} + return &this +} + +// NewSyntheticsTestResultWarningWithDefaults instantiates a new SyntheticsTestResultWarning object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultWarningWithDefaults() *SyntheticsTestResultWarning { + this := SyntheticsTestResultWarning{} + return &this +} + +// GetElementBounds returns the ElementBounds field value if set, zero value otherwise. +func (o *SyntheticsTestResultWarning) GetElementBounds() []SyntheticsTestResultBounds { + if o == nil || o.ElementBounds == nil { + var ret []SyntheticsTestResultBounds + return ret + } + return o.ElementBounds +} + +// GetElementBoundsOk returns a tuple with the ElementBounds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultWarning) GetElementBoundsOk() (*[]SyntheticsTestResultBounds, bool) { + if o == nil || o.ElementBounds == nil { + return nil, false + } + return &o.ElementBounds, true +} + +// HasElementBounds returns a boolean if a field has been set. +func (o *SyntheticsTestResultWarning) HasElementBounds() bool { + return o != nil && o.ElementBounds != nil +} + +// SetElementBounds gets a reference to the given []SyntheticsTestResultBounds and assigns it to the ElementBounds field. +func (o *SyntheticsTestResultWarning) SetElementBounds(v []SyntheticsTestResultBounds) { + o.ElementBounds = v +} + +// GetMessage returns the Message field value if set, zero value otherwise. +func (o *SyntheticsTestResultWarning) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultWarning) GetMessageOk() (*string, bool) { + if o == nil || o.Message == nil { + return nil, false + } + return o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *SyntheticsTestResultWarning) HasMessage() bool { + return o != nil && o.Message != nil +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *SyntheticsTestResultWarning) SetMessage(v string) { + o.Message = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *SyntheticsTestResultWarning) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultWarning) GetTypeOk() (*string, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *SyntheticsTestResultWarning) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *SyntheticsTestResultWarning) SetType(v string) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultWarning) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.ElementBounds != nil { + toSerialize["element_bounds"] = o.ElementBounds + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultWarning) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + ElementBounds []SyntheticsTestResultBounds `json:"element_bounds,omitempty"` + Message *string `json:"message,omitempty"` + Type *string `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"element_bounds", "message", "type"}) + } else { + return err + } + o.ElementBounds = all.ElementBounds + o.Message = all.Message + o.Type = all.Type + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_result_web_socket_close.go b/api/datadogV2/model_synthetics_test_result_web_socket_close.go new file mode 100644 index 00000000000..2ac8e74ecc4 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_result_web_socket_close.go @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestResultWebSocketClose WebSocket close frame information for WebSocket test responses. +type SyntheticsTestResultWebSocketClose struct { + // Reason string received in the close frame. + Reason *string `json:"reason,omitempty"` + // Status code received in the close frame. + StatusCode *int64 `json:"status_code,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewSyntheticsTestResultWebSocketClose instantiates a new SyntheticsTestResultWebSocketClose object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewSyntheticsTestResultWebSocketClose() *SyntheticsTestResultWebSocketClose { + this := SyntheticsTestResultWebSocketClose{} + return &this +} + +// NewSyntheticsTestResultWebSocketCloseWithDefaults instantiates a new SyntheticsTestResultWebSocketClose object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewSyntheticsTestResultWebSocketCloseWithDefaults() *SyntheticsTestResultWebSocketClose { + this := SyntheticsTestResultWebSocketClose{} + return &this +} + +// GetReason returns the Reason field value if set, zero value otherwise. +func (o *SyntheticsTestResultWebSocketClose) GetReason() string { + if o == nil || o.Reason == nil { + var ret string + return ret + } + return *o.Reason +} + +// GetReasonOk returns a tuple with the Reason field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultWebSocketClose) GetReasonOk() (*string, bool) { + if o == nil || o.Reason == nil { + return nil, false + } + return o.Reason, true +} + +// HasReason returns a boolean if a field has been set. +func (o *SyntheticsTestResultWebSocketClose) HasReason() bool { + return o != nil && o.Reason != nil +} + +// SetReason gets a reference to the given string and assigns it to the Reason field. +func (o *SyntheticsTestResultWebSocketClose) SetReason(v string) { + o.Reason = &v +} + +// GetStatusCode returns the StatusCode field value if set, zero value otherwise. +func (o *SyntheticsTestResultWebSocketClose) GetStatusCode() int64 { + if o == nil || o.StatusCode == nil { + var ret int64 + return ret + } + return *o.StatusCode +} + +// GetStatusCodeOk returns a tuple with the StatusCode field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SyntheticsTestResultWebSocketClose) GetStatusCodeOk() (*int64, bool) { + if o == nil || o.StatusCode == nil { + return nil, false + } + return o.StatusCode, true +} + +// HasStatusCode returns a boolean if a field has been set. +func (o *SyntheticsTestResultWebSocketClose) HasStatusCode() bool { + return o != nil && o.StatusCode != nil +} + +// SetStatusCode gets a reference to the given int64 and assigns it to the StatusCode field. +func (o *SyntheticsTestResultWebSocketClose) SetStatusCode(v int64) { + o.StatusCode = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o SyntheticsTestResultWebSocketClose) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Reason != nil { + toSerialize["reason"] = o.Reason + } + if o.StatusCode != nil { + toSerialize["status_code"] = o.StatusCode + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *SyntheticsTestResultWebSocketClose) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Reason *string `json:"reason,omitempty"` + StatusCode *int64 `json:"status_code,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"reason", "status_code"}) + } else { + return err + } + o.Reason = all.Reason + o.StatusCode = all.StatusCode + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_synthetics_test_sub_type.go b/api/datadogV2/model_synthetics_test_sub_type.go new file mode 100644 index 00000000000..5ce5dd8f4cc --- /dev/null +++ b/api/datadogV2/model_synthetics_test_sub_type.go @@ -0,0 +1,82 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestSubType Subtype of the Synthetic test that produced this result. +type SyntheticsTestSubType string + +// List of SyntheticsTestSubType. +const ( + SYNTHETICSTESTSUBTYPE_DNS SyntheticsTestSubType = "dns" + SYNTHETICSTESTSUBTYPE_GRPC SyntheticsTestSubType = "grpc" + SYNTHETICSTESTSUBTYPE_HTTP SyntheticsTestSubType = "http" + SYNTHETICSTESTSUBTYPE_ICMP SyntheticsTestSubType = "icmp" + SYNTHETICSTESTSUBTYPE_MCP SyntheticsTestSubType = "mcp" + SYNTHETICSTESTSUBTYPE_MULTI SyntheticsTestSubType = "multi" + SYNTHETICSTESTSUBTYPE_SSL SyntheticsTestSubType = "ssl" + SYNTHETICSTESTSUBTYPE_TCP SyntheticsTestSubType = "tcp" + SYNTHETICSTESTSUBTYPE_UDP SyntheticsTestSubType = "udp" + SYNTHETICSTESTSUBTYPE_WEBSOCKET SyntheticsTestSubType = "websocket" +) + +var allowedSyntheticsTestSubTypeEnumValues = []SyntheticsTestSubType{ + SYNTHETICSTESTSUBTYPE_DNS, + SYNTHETICSTESTSUBTYPE_GRPC, + SYNTHETICSTESTSUBTYPE_HTTP, + SYNTHETICSTESTSUBTYPE_ICMP, + SYNTHETICSTESTSUBTYPE_MCP, + SYNTHETICSTESTSUBTYPE_MULTI, + SYNTHETICSTESTSUBTYPE_SSL, + SYNTHETICSTESTSUBTYPE_TCP, + SYNTHETICSTESTSUBTYPE_UDP, + SYNTHETICSTESTSUBTYPE_WEBSOCKET, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestSubType) GetAllowedValues() []SyntheticsTestSubType { + return allowedSyntheticsTestSubTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestSubType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestSubType(value) + return nil +} + +// NewSyntheticsTestSubTypeFromValue returns a pointer to a valid SyntheticsTestSubType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestSubTypeFromValue(v string) (*SyntheticsTestSubType, error) { + ev := SyntheticsTestSubType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestSubType: valid values are %v", v, allowedSyntheticsTestSubTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestSubType) IsValid() bool { + for _, existing := range allowedSyntheticsTestSubTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestSubType value. +func (v SyntheticsTestSubType) Ptr() *SyntheticsTestSubType { + return &v +} diff --git a/api/datadogV2/model_synthetics_test_type.go b/api/datadogV2/model_synthetics_test_type.go new file mode 100644 index 00000000000..8e1ae5735f0 --- /dev/null +++ b/api/datadogV2/model_synthetics_test_type.go @@ -0,0 +1,70 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsTestType Type of the Synthetic test that produced this result. +type SyntheticsTestType string + +// List of SyntheticsTestType. +const ( + SYNTHETICSTESTTYPE_API SyntheticsTestType = "api" + SYNTHETICSTESTTYPE_BROWSER SyntheticsTestType = "browser" + SYNTHETICSTESTTYPE_MOBILE SyntheticsTestType = "mobile" + SYNTHETICSTESTTYPE_NETWORK SyntheticsTestType = "network" +) + +var allowedSyntheticsTestTypeEnumValues = []SyntheticsTestType{ + SYNTHETICSTESTTYPE_API, + SYNTHETICSTESTTYPE_BROWSER, + SYNTHETICSTESTTYPE_MOBILE, + SYNTHETICSTESTTYPE_NETWORK, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsTestType) GetAllowedValues() []SyntheticsTestType { + return allowedSyntheticsTestTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsTestType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsTestType(value) + return nil +} + +// NewSyntheticsTestTypeFromValue returns a pointer to a valid SyntheticsTestType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsTestTypeFromValue(v string) (*SyntheticsTestType, error) { + ev := SyntheticsTestType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsTestType: valid values are %v", v, allowedSyntheticsTestTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsTestType) IsValid() bool { + for _, existing := range allowedSyntheticsTestTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsTestType value. +func (v SyntheticsTestType) Ptr() *SyntheticsTestType { + return &v +} diff --git a/examples/v2/synthetics/GetSyntheticsBrowserTestResult.go b/examples/v2/synthetics/GetSyntheticsBrowserTestResult.go new file mode 100644 index 00000000000..60198ed4432 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsBrowserTestResult.go @@ -0,0 +1,29 @@ +// Get a browser test result returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSyntheticsApi(apiClient) + resp, r, err := api.GetSyntheticsBrowserTestResult(ctx, "public_id", "result_id", *datadogV2.NewGetSyntheticsBrowserTestResultOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.GetSyntheticsBrowserTestResult`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.GetSyntheticsBrowserTestResult`:\n%s\n", responseContent) +} diff --git a/examples/v2/synthetics/GetSyntheticsTestResult.go b/examples/v2/synthetics/GetSyntheticsTestResult.go new file mode 100644 index 00000000000..3ead6118016 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsTestResult.go @@ -0,0 +1,29 @@ +// Get a test result returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSyntheticsApi(apiClient) + resp, r, err := api.GetSyntheticsTestResult(ctx, "public_id", "result_id", *datadogV2.NewGetSyntheticsTestResultOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.GetSyntheticsTestResult`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.GetSyntheticsTestResult`:\n%s\n", responseContent) +} diff --git a/examples/v2/synthetics/ListSyntheticsBrowserTestLatestResults.go b/examples/v2/synthetics/ListSyntheticsBrowserTestLatestResults.go new file mode 100644 index 00000000000..faa4d377c9e --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsBrowserTestLatestResults.go @@ -0,0 +1,29 @@ +// Get a browser test's latest results returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSyntheticsApi(apiClient) + resp, r, err := api.ListSyntheticsBrowserTestLatestResults(ctx, "public_id", *datadogV2.NewListSyntheticsBrowserTestLatestResultsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.ListSyntheticsBrowserTestLatestResults`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.ListSyntheticsBrowserTestLatestResults`:\n%s\n", responseContent) +} diff --git a/examples/v2/synthetics/ListSyntheticsTestLatestResults.go b/examples/v2/synthetics/ListSyntheticsTestLatestResults.go new file mode 100644 index 00000000000..a028f01c3f5 --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsTestLatestResults.go @@ -0,0 +1,29 @@ +// Get a test's latest results returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSyntheticsApi(apiClient) + resp, r, err := api.ListSyntheticsTestLatestResults(ctx, "public_id", *datadogV2.NewListSyntheticsTestLatestResultsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.ListSyntheticsTestLatestResults`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.ListSyntheticsTestLatestResults`:\n%s\n", responseContent) +} diff --git a/examples/v2/synthetics/PollSyntheticsTestResults.go b/examples/v2/synthetics/PollSyntheticsTestResults.go new file mode 100644 index 00000000000..760691ef743 --- /dev/null +++ b/examples/v2/synthetics/PollSyntheticsTestResults.go @@ -0,0 +1,29 @@ +// Poll for test results returns "OK" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSyntheticsApi(apiClient) + resp, r, err := api.PollSyntheticsTestResults(ctx, "result_ids") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SyntheticsApi.PollSyntheticsTestResults`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SyntheticsApi.PollSyntheticsTestResults`:\n%s\n", responseContent) +} diff --git a/tests/scenarios/features/v2/synthetics.feature b/tests/scenarios/features/v2/synthetics.feature index 33f538109f9..f847bc0e702 100644 --- a/tests/scenarios/features/v2/synthetics.feature +++ b/tests/scenarios/features/v2/synthetics.feature @@ -151,6 +151,36 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a browser test result returns "API error response." response + Given new "GetSyntheticsBrowserTestResult" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "result_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a browser test result returns "OK" response + Given new "GetSyntheticsBrowserTestResult" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "result_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a browser test's latest results returns "API error response." response + Given new "ListSyntheticsBrowserTestLatestResults" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a browser test's latest results returns "OK" response + Given new "ListSyntheticsBrowserTestLatestResults" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Get a fast test result returns "API error response." response Given new "GetSyntheticsFastTestResult" request @@ -211,6 +241,36 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a test result returns "API error response." response + Given new "GetSyntheticsTestResult" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "result_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a test result returns "OK" response + Given new "GetSyntheticsTestResult" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "result_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a test's latest results returns "API error response." response + Given new "ListSyntheticsTestLatestResults" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Get a test's latest results returns "OK" response + Given new "ListSyntheticsTestLatestResults" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing Scenario: Get available subtests for a multistep test returns "OK" response Given new "GetApiMultistepSubtests" request @@ -322,6 +382,20 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Poll for test results returns "API error response." response + Given new "PollSyntheticsTestResults" request + And request contains "result_ids" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-orchestrating-managing + Scenario: Poll for test results returns "OK" response + Given new "PollSyntheticsTestResults" request + And request contains "result_ids" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-orchestrating-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 061beded331..aa37a18fc34 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -6447,6 +6447,18 @@ "type": "idempotent" } }, + "ListSyntheticsBrowserTestLatestResults": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetSyntheticsBrowserTestResult": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "DeleteSyntheticsTests": { "tag": "Synthetics", "undo": { @@ -6484,6 +6496,12 @@ "type": "idempotent" } }, + "PollSyntheticsTestResults": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "GetTestFileDownloadUrl": { "tag": "Synthetics", "undo": { @@ -6514,6 +6532,18 @@ "type": "safe" } }, + "ListSyntheticsTestLatestResults": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetSyntheticsTestResult": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "ListSyntheticsTestVersions": { "tag": "Synthetics", "undo": {