From a8952846fa92e268b843eaaf6de5044e29d45a37 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 31 Oct 2024 14:51:54 +0000 Subject: [PATCH] Regenerate client from commit e9cc5e6a of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 41 +++++++----- lib/datadog_api_client/inflector.rb | 1 + .../models/synthetics_mobile_step_params.rb | 22 +++---- ...e_step_params_element_relative_position.rb | 4 +- ...tics_mobile_step_params_positions_items.rb | 4 +- .../synthetics_mobile_step_params_value.rb | 63 +++++++++++++++++++ 7 files changed, 109 insertions(+), 34 deletions(-) create mode 100644 lib/datadog_api_client/v1/models/synthetics_mobile_step_params_value.rb diff --git a/.apigentools-info b/.apigentools-info index 3127a51d3ddc..e38dee8acf35 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 14:19:55.243697", - "spec_repo_commit": "47da2e01" + "regenerated": "2024-10-31 14:51:29.321354", + "spec_repo_commit": "e9cc5e6a" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-10-31 14:19:55.263009", - "spec_repo_commit": "47da2e01" + "regenerated": "2024-10-31 14:51:29.340011", + "spec_repo_commit": "e9cc5e6a" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index f12bb5661a01..7bd4ab4a9439 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15530,7 +15530,7 @@ components: $ref: '#/components/schemas/SyntheticsMobileStepParamsDirection' element: $ref: '#/components/schemas/SyntheticsMobileStepParamsElement' - enable: + enabled: description: Boolean to change the state of the wifi for a `toggleWiFi` step type. type: boolean @@ -15546,8 +15546,7 @@ components: step type. type: string value: - description: Values used in the step. Used in multiple step types. - type: string + $ref: '#/components/schemas/SyntheticsMobileStepParamsValue' variable: $ref: '#/components/schemas/SyntheticsMobileStepParamsVariable' withEnter: @@ -15556,12 +15555,12 @@ components: type: boolean x: description: Amount to scroll by on the `x` axis for a `scroll` step type. - format: int64 - type: integer + format: double + type: number y: description: Amount to scroll by on the `y` axis for a `scroll` step type. - format: int64 - type: integer + format: double + type: number type: object SyntheticsMobileStepParamsDirection: description: The direction of the scroll for a `scrollToElement` step type. @@ -15615,12 +15614,12 @@ components: properties: x: description: The `relativePosition` on the `x` axis for the element. - format: int64 - type: integer + format: double + type: number y: description: The `relativePosition` on the `y` axis for the element. - format: int64 - type: integer + format: double + type: number type: object SyntheticsMobileStepParamsElementUserLocator: description: User locator to find the element. @@ -15670,13 +15669,25 @@ components: properties: x: description: The `x` position for the flick. - format: int64 - type: integer + format: double + type: number y: description: The `y` position for the flick. - format: int64 - type: integer + format: double + type: number type: object + SyntheticsMobileStepParamsValue: + description: Values used in the step for in multiple step types. + oneOf: + - $ref: '#/components/schemas/SyntheticsMobileStepParamsValueString' + - $ref: '#/components/schemas/SyntheticsMobileStepParamsValueNumber' + SyntheticsMobileStepParamsValueNumber: + description: Value used in the step for in multiple step types. + format: int64 + type: integer + SyntheticsMobileStepParamsValueString: + description: Value used in the step for in multiple step types. + type: string SyntheticsMobileStepParamsVariable: description: Variable object for `extractVariable` step type. properties: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 02718c5d8d9c..0bcdf4f7aad9 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -646,6 +646,7 @@ def overrides "v1.synthetics_mobile_step_params_element_user_locator_values_items" => "SyntheticsMobileStepParamsElementUserLocatorValuesItems", "v1.synthetics_mobile_step_params_element_user_locator_values_items_type" => "SyntheticsMobileStepParamsElementUserLocatorValuesItemsType", "v1.synthetics_mobile_step_params_positions_items" => "SyntheticsMobileStepParamsPositionsItems", + "v1.synthetics_mobile_step_params_value" => "SyntheticsMobileStepParamsValue", "v1.synthetics_mobile_step_params_variable" => "SyntheticsMobileStepParamsVariable", "v1.synthetics_mobile_step_type" => "SyntheticsMobileStepType", "v1.synthetics_mobile_test" => "SyntheticsMobileTest", diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb index f01da18c6129..9cd83c3eb9b3 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params.rb @@ -34,7 +34,7 @@ class SyntheticsMobileStepParams attr_accessor :element # Boolean to change the state of the wifi for a `toggleWiFi` step type. - attr_accessor :enable + attr_accessor :enabled # Maximum number of scrolls to do for a `scrollToElement` step type. attr_accessor :max_scrolls @@ -45,7 +45,7 @@ class SyntheticsMobileStepParams # Public ID of the test to be played as part of a `playSubTest` step type. attr_accessor :subtest_public_id - # Values used in the step. Used in multiple step types. + # Values used in the step for in multiple step types. attr_accessor :value # Variable object for `extractVariable` step type. @@ -70,7 +70,7 @@ def self.attribute_map :'delay' => :'delay', :'direction' => :'direction', :'element' => :'element', - :'enable' => :'enable', + :'enabled' => :'enabled', :'max_scrolls' => :'maxScrolls', :'positions' => :'positions', :'subtest_public_id' => :'subtestPublicId', @@ -90,15 +90,15 @@ def self.openapi_types :'delay' => :'Integer', :'direction' => :'SyntheticsMobileStepParamsDirection', :'element' => :'SyntheticsMobileStepParamsElement', - :'enable' => :'Boolean', + :'enabled' => :'Boolean', :'max_scrolls' => :'Integer', :'positions' => :'Array', :'subtest_public_id' => :'String', - :'value' => :'String', + :'value' => :'SyntheticsMobileStepParamsValue', :'variable' => :'SyntheticsMobileStepParamsVariable', :'with_enter' => :'Boolean', - :'x' => :'Integer', - :'y' => :'Integer' + :'x' => :'Float', + :'y' => :'Float' } end @@ -136,8 +136,8 @@ def initialize(attributes = {}) self.element = attributes[:'element'] end - if attributes.key?(:'enable') - self.enable = attributes[:'enable'] + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] end if attributes.key?(:'max_scrolls') @@ -227,7 +227,7 @@ def ==(o) delay == o.delay && direction == o.direction && element == o.element && - enable == o.enable && + enabled == o.enabled && max_scrolls == o.max_scrolls && positions == o.positions && subtest_public_id == o.subtest_public_id && @@ -243,7 +243,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [check, delay, direction, element, enable, max_scrolls, positions, subtest_public_id, value, variable, with_enter, x, y].hash + [check, delay, direction, element, enabled, max_scrolls, positions, subtest_public_id, value, variable, with_enter, x, y].hash end end end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb index 484ec7c6af5e..aca2e96863d9 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_element_relative_position.rb @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'x' => :'Integer', - :'y' => :'Integer' + :'x' => :'Float', + :'y' => :'Float' } end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb index fde6ff4fc394..412a271464fc 100644 --- a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_positions_items.rb @@ -42,8 +42,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'x' => :'Integer', - :'y' => :'Integer' + :'x' => :'Float', + :'y' => :'Float' } end diff --git a/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_value.rb b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_value.rb new file mode 100644 index 000000000000..de4df4975625 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_mobile_step_params_value.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Values used in the step for in multiple step types. + module SyntheticsMobileStepParamsValue + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'String', + :'Integer' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end