diff --git a/.apigentools-info b/.apigentools-info index ed999a7109..4e5446b4d3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-02-11 17:09:49.390149", - "spec_repo_commit": "f8964dd" + "regenerated": "2022-02-14 18:02:49.536307", + "spec_repo_commit": "e72d1cd" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-02-11 17:09:49.404192", - "spec_repo_commit": "f8964dd" + "regenerated": "2022-02-14 18:02:49.548290", + "spec_repo_commit": "e72d1cd" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index c1ffad5ed6..2fee07a50c 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2563,7 +2563,10 @@ components: example: '@browser.name:Chrome' type: string steps: - $ref: '#/components/schemas/FunnelSteps' + description: List of funnel steps. + items: + $ref: '#/components/schemas/FunnelStep' + type: array required: - query_string - data_source @@ -2586,24 +2589,21 @@ components: type: string x-enum-varnames: - RUM - FunnelSteps: - description: List of funnel steps. - items: - description: The funnel step. - properties: - facet: - description: The facet of the step. - example: '@view.name' - type: string - value: - description: The value of the step. - example: /apm/home - type: string - required: - - facet - - value - type: object - type: array + FunnelStep: + description: The funnel step. + properties: + facet: + description: The facet of the step. + example: '@view.name' + type: string + value: + description: The value of the step. + example: /apm/home + type: string + required: + - facet + - value + type: object FunnelWidgetDefinition: description: 'The funnel visualization displays a funnel of user sessions that maps a sequence of view navigation and user interaction in your application. diff --git a/docs/datadog_api_client.v1.model.rst b/docs/datadog_api_client.v1.model.rst index c4b1fb307e..b5a0d45d94 100644 --- a/docs/datadog_api_client.v1.model.rst +++ b/docs/datadog_api_client.v1.model.rst @@ -889,10 +889,10 @@ funnel\_source :undoc-members: :show-inheritance: -funnel\_steps -------------- +funnel\_step +------------ -.. automodule:: datadog_api_client.v1.model.funnel_steps +.. automodule:: datadog_api_client.v1.model.funnel_step :members: :undoc-members: :show-inheritance: diff --git a/examples/v1/dashboards/CreateDashboard_927141680.py b/examples/v1/dashboards/CreateDashboard_927141680.py index 6bb1220321..b7e428e9b4 100644 --- a/examples/v1/dashboards/CreateDashboard_927141680.py +++ b/examples/v1/dashboards/CreateDashboard_927141680.py @@ -9,7 +9,6 @@ from datadog_api_client.v1.model.funnel_query import FunnelQuery from datadog_api_client.v1.model.funnel_request_type import FunnelRequestType from datadog_api_client.v1.model.funnel_source import FunnelSource -from datadog_api_client.v1.model.funnel_steps import FunnelSteps from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.funnel_widget_definition_type import FunnelWidgetDefinitionType from datadog_api_client.v1.model.funnel_widget_request import FunnelWidgetRequest @@ -24,7 +23,7 @@ type=FunnelWidgetDefinitionType("funnel"), requests=[ FunnelWidgetRequest( - query=FunnelQuery(data_source=FunnelSource("rum"), query_string="", steps=FunnelSteps([])), + query=FunnelQuery(data_source=FunnelSource("rum"), query_string="", steps=[]), request_type=FunnelRequestType("funnel"), ) ], diff --git a/src/datadog_api_client/v1/model/funnel_query.py b/src/datadog_api_client/v1/model/funnel_query.py index b2c5e26685..238e708871 100644 --- a/src/datadog_api_client/v1/model/funnel_query.py +++ b/src/datadog_api_client/v1/model/funnel_query.py @@ -11,10 +11,10 @@ def lazy_import(): from datadog_api_client.v1.model.funnel_source import FunnelSource - from datadog_api_client.v1.model.funnel_steps import FunnelSteps + from datadog_api_client.v1.model.funnel_step import FunnelStep globals()["FunnelSource"] = FunnelSource - globals()["FunnelSteps"] = FunnelSteps + globals()["FunnelStep"] = FunnelStep class FunnelQuery(ModelNormal): @@ -32,7 +32,7 @@ def openapi_types(): return { "data_source": (FunnelSource,), "query_string": (str,), - "steps": (FunnelSteps,), + "steps": ([FunnelStep],), } attribute_map = { @@ -52,7 +52,8 @@ def __init__(self, data_source, query_string, steps, *args, **kwargs): :param query_string: The widget query. :type query_string: str - :type steps: FunnelSteps + :param steps: List of funnel steps. + :type steps: [FunnelStep] """ super().__init__(kwargs) diff --git a/src/datadog_api_client/v1/model/funnel_step.py b/src/datadog_api_client/v1/model/funnel_step.py new file mode 100644 index 0000000000..9dda124fa7 --- /dev/null +++ b/src/datadog_api_client/v1/model/funnel_step.py @@ -0,0 +1,62 @@ +# 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. + + +from datadog_api_client.v1.model_utils import ( + ModelNormal, + cached_property, +) + + +class FunnelStep(ModelNormal): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + validations = {} + + @cached_property + def openapi_types(): + return { + "facet": (str,), + "value": (str,), + } + + attribute_map = { + "facet": "facet", + "value": "value", + } + + read_only_vars = {} + + def __init__(self, facet, value, *args, **kwargs): + """FunnelStep - a model defined in OpenAPI + + + :param facet: The facet of the step. + :type facet: str + + :param value: The value of the step. + :type value: str + """ + super().__init__(kwargs) + + self._check_pos_args(args) + + self.facet = facet + self.value = value + + @classmethod + def _from_openapi_data(cls, facet, value, *args, **kwargs): + """Helper creating a new instance from a response.""" + + self = super(FunnelStep, cls)._from_openapi_data(kwargs) + + self._check_pos_args(args) + + self.facet = facet + self.value = value + return self diff --git a/src/datadog_api_client/v1/model/funnel_steps.py b/src/datadog_api_client/v1/model/funnel_steps.py deleted file mode 100644 index 6c86b1cb1c..0000000000 --- a/src/datadog_api_client/v1/model/funnel_steps.py +++ /dev/null @@ -1,58 +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. - - -from datadog_api_client.v1.model_utils import ( - ApiTypeError, - ModelSimple, - cached_property, -) - - -class FunnelSteps(ModelSimple): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - validations = {} - - @cached_property - def openapi_types(): - return { - "value": ([dict],), - } - - def __init__(self, *args, **kwargs): - """FunnelSteps - a model defined in OpenAPI - - Note that value can be passed either in args or in kwargs, but not in both. - :param value: List of funnel steps. - :type value: [dict] - """ - super().__init__(kwargs) - - if "value" in kwargs: - value = kwargs.pop("value") - elif args: - args = list(args) - value = args.pop(0) - else: - raise ApiTypeError( - "value is required, but not passed in args or kwargs and doesn't have default", - path_to_item=self._path_to_item, - valid_classes=(self.__class__,), - ) - - self._check_pos_args(args) - - self.value = value - - self._check_kw_args(kwargs) - - @classmethod - def _from_openapi_data(cls, *args, **kwargs): - """Helper creating a new instance from a response.""" - return cls(*args, **kwargs) diff --git a/src/datadog_api_client/v1/models/__init__.py b/src/datadog_api_client/v1/models/__init__.py index ba13ef3d1d..fb8812df47 100644 --- a/src/datadog_api_client/v1/models/__init__.py +++ b/src/datadog_api_client/v1/models/__init__.py @@ -146,7 +146,7 @@ from datadog_api_client.v1.model.funnel_query import FunnelQuery from datadog_api_client.v1.model.funnel_request_type import FunnelRequestType from datadog_api_client.v1.model.funnel_source import FunnelSource -from datadog_api_client.v1.model.funnel_steps import FunnelSteps +from datadog_api_client.v1.model.funnel_step import FunnelStep from datadog_api_client.v1.model.funnel_widget_definition import FunnelWidgetDefinition from datadog_api_client.v1.model.funnel_widget_definition_type import FunnelWidgetDefinitionType from datadog_api_client.v1.model.funnel_widget_request import FunnelWidgetRequest