From 82a3b7d52158a317bdade07e38908062ca7a2eb0 Mon Sep 17 00:00:00 2001 From: Rudolf the Rabbit Date: Thu, 23 Jul 2026 14:51:42 +0000 Subject: [PATCH] chore: update OpenAPI client to 2026.07.23.1437-b2374db --- openapi/schemas/campaign.openapi.json | 270 +++++++++--------- .../schemas/rapidata.filtered.openapi.json | 270 +++++++++--------- openapi/schemas/rapidata.openapi.json | 270 +++++++++--------- src/rapidata/api_client/api/campaign_api.py | 12 +- ...paign_by_id_endpoint_i_campaign_details.py | 137 +++++++++ ...by_id_endpoint_program_campaign_details.py | 178 ++++++++++++ ..._by_id_endpoint_routed_campaign_details.py | 165 +++++++++++ src/rapidata/api_client_README.md | 6 +- 8 files changed, 894 insertions(+), 414 deletions(-) create mode 100644 src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details.py create mode 100644 src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_program_campaign_details.py create mode 100644 src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_routed_campaign_details.py diff --git a/openapi/schemas/campaign.openapi.json b/openapi/schemas/campaign.openapi.json index 9885fc902..59ed37d6f 100644 --- a/openapi/schemas/campaign.openapi.json +++ b/openapi/schemas/campaign.openapi.json @@ -268,7 +268,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ICampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetails" } } } @@ -2023,156 +2023,29 @@ } } }, - "GetCampaignCacheEndpoint_CampaignEntry": { - "required": [ - "id", - "name", - "status", - "priority", - "filterCount", - "selectionCount", - "userScoreDimensionCount", - "featureFlagCount", - "rateLimitCount", - "isPreviewEnabled", - "boostingControlMode" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/CampaignStatus" - }, - "priority": { - "type": "integer", - "format": "int32" - }, - "filterCount": { - "type": "integer", - "format": "int32" - }, - "selectionCount": { - "type": "integer", - "format": "int32" - }, - "userScoreDimensionCount": { - "type": "integer", - "format": "int32" - }, - "featureFlagCount": { - "type": "integer", - "format": "int32" - }, - "rateLimitCount": { - "type": "integer", - "format": "int32" - }, - "isPreviewEnabled": { - "type": "boolean" - }, - "boostingControlMode": { - "$ref": "#/components/schemas/BoostingControlMode" - } - } - }, - "GetCampaignCacheEndpoint_Output": { - "required": [ - "count", - "campaigns" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached campaigns.", - "format": "int32" - }, - "campaigns": { - "allOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" - } - } - ], - "description": "The list of cached campaign summaries." - } - } - }, - "GetFastBidMultiplierEndpoint_Output": { - "required": [ - "externalCampaignId", - "bidMultiplierValue" - ], - "type": "object", - "properties": { - "externalCampaignId": { - "type": "integer", - "description": "The external campaign id reported by the downstream system.", - "format": "int32" - }, - "bidMultiplierValue": { - "type": "number", - "description": "The current bid multiplier reported for the campaign.", - "format": "double" - } - } - }, - "GetUserScoreCacheEndpoint_Output": { - "required": [ - "count", - "scores" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached user scores.", - "format": "int32" - }, - "scores": { - "allOf": [ - { - "type": "object", - "additionalProperties": { - "type": "number", - "format": "double" - } - } - ], - "description": "The cached dimension-to-score mappings." - } - } - }, - "ICampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetails": { "required": [ "_t" ], "type": "object", "oneOf": [ { - "$ref": "#/components/schemas/ICampaignDetailsProgramCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails" }, { - "$ref": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } ], "description": "A campaign's details, identified by a discriminator. Implementations describe the\n type-specific configuration: a routed campaign's selections or a program campaign's\n stream program.", "discriminator": { "propertyName": "_t", "mapping": { - "ProgramCampaign": "#/components/schemas/ICampaignDetailsProgramCampaignDetails", - "RoutedCampaign": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "RoutedCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails", + "ProgramCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } } }, - "ICampaignDetailsProgramCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails": { "required": [ "id", "name", @@ -2329,7 +2202,7 @@ }, "description": "A program campaign: its sessions stream their rapids, driven by a stream program." }, - "ICampaignDetailsRoutedCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails": { "required": [ "id", "name", @@ -2463,6 +2336,133 @@ }, "description": "A routed campaign: its rapids are served from a fixed selection list." }, + "GetCampaignCacheEndpoint_CampaignEntry": { + "required": [ + "id", + "name", + "status", + "priority", + "filterCount", + "selectionCount", + "userScoreDimensionCount", + "featureFlagCount", + "rateLimitCount", + "isPreviewEnabled", + "boostingControlMode" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CampaignStatus" + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "filterCount": { + "type": "integer", + "format": "int32" + }, + "selectionCount": { + "type": "integer", + "format": "int32" + }, + "userScoreDimensionCount": { + "type": "integer", + "format": "int32" + }, + "featureFlagCount": { + "type": "integer", + "format": "int32" + }, + "rateLimitCount": { + "type": "integer", + "format": "int32" + }, + "isPreviewEnabled": { + "type": "boolean" + }, + "boostingControlMode": { + "$ref": "#/components/schemas/BoostingControlMode" + } + } + }, + "GetCampaignCacheEndpoint_Output": { + "required": [ + "count", + "campaigns" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached campaigns.", + "format": "int32" + }, + "campaigns": { + "allOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" + } + } + ], + "description": "The list of cached campaign summaries." + } + } + }, + "GetFastBidMultiplierEndpoint_Output": { + "required": [ + "externalCampaignId", + "bidMultiplierValue" + ], + "type": "object", + "properties": { + "externalCampaignId": { + "type": "integer", + "description": "The external campaign id reported by the downstream system.", + "format": "int32" + }, + "bidMultiplierValue": { + "type": "number", + "description": "The current bid multiplier reported for the campaign.", + "format": "double" + } + } + }, + "GetUserScoreCacheEndpoint_Output": { + "required": [ + "count", + "scores" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached user scores.", + "format": "int32" + }, + "scores": { + "allOf": [ + { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + ], + "description": "The cached dimension-to-score mappings." + } + } + }, "ICampaignFilter": { "required": [ "_t" diff --git a/openapi/schemas/rapidata.filtered.openapi.json b/openapi/schemas/rapidata.filtered.openapi.json index 4bc600e12..21eb69631 100644 --- a/openapi/schemas/rapidata.filtered.openapi.json +++ b/openapi/schemas/rapidata.filtered.openapi.json @@ -3349,7 +3349,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ICampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetails" } } } @@ -39327,156 +39327,29 @@ } } }, - "GetCampaignCacheEndpoint_CampaignEntry": { - "required": [ - "id", - "name", - "status", - "priority", - "filterCount", - "selectionCount", - "userScoreDimensionCount", - "featureFlagCount", - "rateLimitCount", - "isPreviewEnabled", - "boostingControlMode" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/CampaignStatus" - }, - "priority": { - "type": "integer", - "format": "int32" - }, - "filterCount": { - "type": "integer", - "format": "int32" - }, - "selectionCount": { - "type": "integer", - "format": "int32" - }, - "userScoreDimensionCount": { - "type": "integer", - "format": "int32" - }, - "featureFlagCount": { - "type": "integer", - "format": "int32" - }, - "rateLimitCount": { - "type": "integer", - "format": "int32" - }, - "isPreviewEnabled": { - "type": "boolean" - }, - "boostingControlMode": { - "$ref": "#/components/schemas/BoostingControlMode" - } - } - }, - "GetCampaignCacheEndpoint_Output": { - "required": [ - "count", - "campaigns" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached campaigns.", - "format": "int32" - }, - "campaigns": { - "allOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" - } - } - ], - "description": "The list of cached campaign summaries." - } - } - }, - "GetFastBidMultiplierEndpoint_Output": { - "required": [ - "externalCampaignId", - "bidMultiplierValue" - ], - "type": "object", - "properties": { - "externalCampaignId": { - "type": "integer", - "description": "The external campaign id reported by the downstream system.", - "format": "int32" - }, - "bidMultiplierValue": { - "type": "number", - "description": "The current bid multiplier reported for the campaign.", - "format": "double" - } - } - }, - "GetUserScoreCacheEndpoint_Output": { - "required": [ - "count", - "scores" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached user scores.", - "format": "int32" - }, - "scores": { - "allOf": [ - { - "type": "object", - "additionalProperties": { - "type": "number", - "format": "double" - } - } - ], - "description": "The cached dimension-to-score mappings." - } - } - }, - "ICampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetails": { "required": [ "_t" ], "type": "object", "oneOf": [ { - "$ref": "#/components/schemas/ICampaignDetailsProgramCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails" }, { - "$ref": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } ], "description": "A campaign's details, identified by a discriminator. Implementations describe the\n type-specific configuration: a routed campaign's selections or a program campaign's\n stream program.", "discriminator": { "propertyName": "_t", "mapping": { - "ProgramCampaign": "#/components/schemas/ICampaignDetailsProgramCampaignDetails", - "RoutedCampaign": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "RoutedCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails", + "ProgramCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } } }, - "ICampaignDetailsProgramCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails": { "required": [ "id", "name", @@ -39628,7 +39501,7 @@ }, "description": "A program campaign: its sessions stream their rapids, driven by a stream program." }, - "ICampaignDetailsRoutedCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails": { "required": [ "id", "name", @@ -39757,6 +39630,133 @@ }, "description": "A routed campaign: its rapids are served from a fixed selection list." }, + "GetCampaignCacheEndpoint_CampaignEntry": { + "required": [ + "id", + "name", + "status", + "priority", + "filterCount", + "selectionCount", + "userScoreDimensionCount", + "featureFlagCount", + "rateLimitCount", + "isPreviewEnabled", + "boostingControlMode" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CampaignStatus" + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "filterCount": { + "type": "integer", + "format": "int32" + }, + "selectionCount": { + "type": "integer", + "format": "int32" + }, + "userScoreDimensionCount": { + "type": "integer", + "format": "int32" + }, + "featureFlagCount": { + "type": "integer", + "format": "int32" + }, + "rateLimitCount": { + "type": "integer", + "format": "int32" + }, + "isPreviewEnabled": { + "type": "boolean" + }, + "boostingControlMode": { + "$ref": "#/components/schemas/BoostingControlMode" + } + } + }, + "GetCampaignCacheEndpoint_Output": { + "required": [ + "count", + "campaigns" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached campaigns.", + "format": "int32" + }, + "campaigns": { + "allOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" + } + } + ], + "description": "The list of cached campaign summaries." + } + } + }, + "GetFastBidMultiplierEndpoint_Output": { + "required": [ + "externalCampaignId", + "bidMultiplierValue" + ], + "type": "object", + "properties": { + "externalCampaignId": { + "type": "integer", + "description": "The external campaign id reported by the downstream system.", + "format": "int32" + }, + "bidMultiplierValue": { + "type": "number", + "description": "The current bid multiplier reported for the campaign.", + "format": "double" + } + } + }, + "GetUserScoreCacheEndpoint_Output": { + "required": [ + "count", + "scores" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached user scores.", + "format": "int32" + }, + "scores": { + "allOf": [ + { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + ], + "description": "The cached dimension-to-score mappings." + } + } + }, "ICampaignFilter": { "required": [ "_t" diff --git a/openapi/schemas/rapidata.openapi.json b/openapi/schemas/rapidata.openapi.json index 396a00404..e109aaa2b 100644 --- a/openapi/schemas/rapidata.openapi.json +++ b/openapi/schemas/rapidata.openapi.json @@ -3399,7 +3399,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ICampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetails" } } } @@ -41087,156 +41087,29 @@ } } }, - "GetCampaignCacheEndpoint_CampaignEntry": { - "required": [ - "id", - "name", - "status", - "priority", - "filterCount", - "selectionCount", - "userScoreDimensionCount", - "featureFlagCount", - "rateLimitCount", - "isPreviewEnabled", - "boostingControlMode" - ], - "type": "object", - "properties": { - "id": { - "type": "string" - }, - "name": { - "type": "string" - }, - "status": { - "$ref": "#/components/schemas/CampaignStatus" - }, - "priority": { - "type": "integer", - "format": "int32" - }, - "filterCount": { - "type": "integer", - "format": "int32" - }, - "selectionCount": { - "type": "integer", - "format": "int32" - }, - "userScoreDimensionCount": { - "type": "integer", - "format": "int32" - }, - "featureFlagCount": { - "type": "integer", - "format": "int32" - }, - "rateLimitCount": { - "type": "integer", - "format": "int32" - }, - "isPreviewEnabled": { - "type": "boolean" - }, - "boostingControlMode": { - "$ref": "#/components/schemas/BoostingControlMode" - } - } - }, - "GetCampaignCacheEndpoint_Output": { - "required": [ - "count", - "campaigns" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached campaigns.", - "format": "int32" - }, - "campaigns": { - "allOf": [ - { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" - } - } - ], - "description": "The list of cached campaign summaries." - } - } - }, - "GetFastBidMultiplierEndpoint_Output": { - "required": [ - "externalCampaignId", - "bidMultiplierValue" - ], - "type": "object", - "properties": { - "externalCampaignId": { - "type": "integer", - "description": "The external campaign id reported by the downstream system.", - "format": "int32" - }, - "bidMultiplierValue": { - "type": "number", - "description": "The current bid multiplier reported for the campaign.", - "format": "double" - } - } - }, - "GetUserScoreCacheEndpoint_Output": { - "required": [ - "count", - "scores" - ], - "type": "object", - "properties": { - "count": { - "type": "integer", - "description": "The total number of cached user scores.", - "format": "int32" - }, - "scores": { - "allOf": [ - { - "type": "object", - "additionalProperties": { - "type": "number", - "format": "double" - } - } - ], - "description": "The cached dimension-to-score mappings." - } - } - }, - "ICampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetails": { "required": [ "_t" ], "type": "object", "oneOf": [ { - "$ref": "#/components/schemas/ICampaignDetailsProgramCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails" }, { - "$ref": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "$ref": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } ], "description": "A campaign's details, identified by a discriminator. Implementations describe the\n type-specific configuration: a routed campaign's selections or a program campaign's\n stream program.", "discriminator": { "propertyName": "_t", "mapping": { - "ProgramCampaign": "#/components/schemas/ICampaignDetailsProgramCampaignDetails", - "RoutedCampaign": "#/components/schemas/ICampaignDetailsRoutedCampaignDetails" + "RoutedCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails", + "ProgramCampaign": "#/components/schemas/GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails" } } }, - "ICampaignDetailsProgramCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_ProgramCampaignDetails": { "required": [ "id", "name", @@ -41393,7 +41266,7 @@ }, "description": "A program campaign: its sessions stream their rapids, driven by a stream program." }, - "ICampaignDetailsRoutedCampaignDetails": { + "GetCampaignByIdEndpoint_ICampaignDetailsGetCampaignByIdEndpoint_RoutedCampaignDetails": { "required": [ "id", "name", @@ -41527,6 +41400,133 @@ }, "description": "A routed campaign: its rapids are served from a fixed selection list." }, + "GetCampaignCacheEndpoint_CampaignEntry": { + "required": [ + "id", + "name", + "status", + "priority", + "filterCount", + "selectionCount", + "userScoreDimensionCount", + "featureFlagCount", + "rateLimitCount", + "isPreviewEnabled", + "boostingControlMode" + ], + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "status": { + "$ref": "#/components/schemas/CampaignStatus" + }, + "priority": { + "type": "integer", + "format": "int32" + }, + "filterCount": { + "type": "integer", + "format": "int32" + }, + "selectionCount": { + "type": "integer", + "format": "int32" + }, + "userScoreDimensionCount": { + "type": "integer", + "format": "int32" + }, + "featureFlagCount": { + "type": "integer", + "format": "int32" + }, + "rateLimitCount": { + "type": "integer", + "format": "int32" + }, + "isPreviewEnabled": { + "type": "boolean" + }, + "boostingControlMode": { + "$ref": "#/components/schemas/BoostingControlMode" + } + } + }, + "GetCampaignCacheEndpoint_Output": { + "required": [ + "count", + "campaigns" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached campaigns.", + "format": "int32" + }, + "campaigns": { + "allOf": [ + { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetCampaignCacheEndpoint_CampaignEntry" + } + } + ], + "description": "The list of cached campaign summaries." + } + } + }, + "GetFastBidMultiplierEndpoint_Output": { + "required": [ + "externalCampaignId", + "bidMultiplierValue" + ], + "type": "object", + "properties": { + "externalCampaignId": { + "type": "integer", + "description": "The external campaign id reported by the downstream system.", + "format": "int32" + }, + "bidMultiplierValue": { + "type": "number", + "description": "The current bid multiplier reported for the campaign.", + "format": "double" + } + } + }, + "GetUserScoreCacheEndpoint_Output": { + "required": [ + "count", + "scores" + ], + "type": "object", + "properties": { + "count": { + "type": "integer", + "description": "The total number of cached user scores.", + "format": "int32" + }, + "scores": { + "allOf": [ + { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + ], + "description": "The cached dimension-to-score mappings." + } + } + }, "ICampaignFilter": { "required": [ "_t" diff --git a/src/rapidata/api_client/api/campaign_api.py b/src/rapidata/api_client/api/campaign_api.py index 649ab6676..2a6be67e9 100644 --- a/src/rapidata/api_client/api/campaign_api.py +++ b/src/rapidata/api_client/api/campaign_api.py @@ -23,8 +23,8 @@ from rapidata.api_client.models.create_program_campaign_endpoint_output import CreateProgramCampaignEndpointOutput from rapidata.api_client.models.get_boost_insights_endpoint_output import GetBoostInsightsEndpointOutput from rapidata.api_client.models.get_boost_status_endpoint_output import GetBoostStatusEndpointOutput +from rapidata.api_client.models.get_campaign_by_id_endpoint_i_campaign_details import GetCampaignByIdEndpointICampaignDetails from rapidata.api_client.models.get_fast_bid_multiplier_endpoint_output import GetFastBidMultiplierEndpointOutput -from rapidata.api_client.models.i_campaign_details import ICampaignDetails from rapidata.api_client.models.query_campaigns_endpoint_paged_result_of_output import QueryCampaignsEndpointPagedResultOfOutput from rapidata.api_client.models.set_fast_bid_multiplier_endpoint_input import SetFastBidMultiplierEndpointInput from rapidata.api_client.models.set_fast_bid_multiplier_endpoint_output import SetFastBidMultiplierEndpointOutput @@ -1670,7 +1670,7 @@ def campaign_campaign_id_get( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ICampaignDetails: + ) -> GetCampaignByIdEndpointICampaignDetails: """Retrieves the details of a specific campaign. The response is discriminated by campaign kind: a program campaign includes its stream program, a routed campaign includes its selections. @@ -1708,7 +1708,7 @@ def campaign_campaign_id_get( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ICampaignDetails", + '200': "GetCampaignByIdEndpointICampaignDetails", '400': "ValidationProblemDetails", '401': None, '403': None, @@ -1740,7 +1740,7 @@ def campaign_campaign_id_get_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ICampaignDetails]: + ) -> ApiResponse[GetCampaignByIdEndpointICampaignDetails]: """Retrieves the details of a specific campaign. The response is discriminated by campaign kind: a program campaign includes its stream program, a routed campaign includes its selections. @@ -1778,7 +1778,7 @@ def campaign_campaign_id_get_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ICampaignDetails", + '200': "GetCampaignByIdEndpointICampaignDetails", '400': "ValidationProblemDetails", '401': None, '403': None, @@ -1848,7 +1848,7 @@ def campaign_campaign_id_get_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ICampaignDetails", + '200': "GetCampaignByIdEndpointICampaignDetails", '400': "ValidationProblemDetails", '401': None, '403': None, diff --git a/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details.py b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details.py new file mode 100644 index 000000000..b115f7a4f --- /dev/null +++ b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from rapidata.api_client.models.get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_program_campaign_details import GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails +from rapidata.api_client.models.get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_routed_campaign_details import GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails +from pydantic import StrictStr, Field +from rapidata.api_client.lazy_model import LazyValidatedModel +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +GETCAMPAIGNBYIDENDPOINTICAMPAIGNDETAILS_ONE_OF_SCHEMAS = ["GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails", "GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails"] + +class GetCampaignByIdEndpointICampaignDetails(LazyValidatedModel): + """ + A campaign's details, identified by a discriminator. Implementations describe the type-specific configuration: a routed campaign's selections or a program campaign's stream program. + """ + # data type: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails + oneof_schema_1_validator: Optional[GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails] = None + # data type: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails + oneof_schema_2_validator: Optional[GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails] = None + actual_instance: Optional[Union[GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails]] = None + one_of_schemas: Set[str] = { "GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails", "GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails" } + + # model_config is inherited from LazyValidatedModel + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = GetCampaignByIdEndpointICampaignDetails.model_construct() + error_messages = [] + match = 0 + # validate data type: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails + if not isinstance(v, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails`") + else: + match += 1 + # validate data type: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails + if not isinstance(v, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails): + error_messages.append(f"Error! Input type `{type(v)}` is not `GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in GetCampaignByIdEndpointICampaignDetails with oneOf schemas: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in GetCampaignByIdEndpointICampaignDetails with oneOf schemas: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails + try: + instance.actual_instance = GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails + try: + instance.actual_instance = GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into GetCampaignByIdEndpointICampaignDetails with oneOf schemas: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into GetCampaignByIdEndpointICampaignDetails with oneOf schemas: GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails, GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_program_campaign_details.py b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_program_campaign_details.py new file mode 100644 index 000000000..1b6b74eae --- /dev/null +++ b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_program_campaign_details.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from rapidata.api_client.models.boosting_control_mode import BoostingControlMode +from rapidata.api_client.models.boosting_profile import BoostingProfile +from rapidata.api_client.models.campaign_status import CampaignStatus +from rapidata.api_client.models.feature_flag import FeatureFlag +from rapidata.api_client.models.i_campaign_filter import ICampaignFilter +from rapidata.api_client.models.i_program_node import IProgramNode +from rapidata.api_client.models.sticky_config import StickyConfig +from pydantic import ValidationError +from rapidata.api_client.lazy_model import LazyValidatedModel +from typing import Optional, Set +from typing_extensions import Self + +class GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails(LazyValidatedModel): + """ + A program campaign: its sessions stream their rapids, driven by a stream program. + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + id: StrictStr = Field(description="The unique identifier of the campaign.") + name: StrictStr = Field(description="The name of the campaign.") + status: CampaignStatus = Field(description="The current status of the campaign.") + priority: StrictInt = Field(description="The priority level of the campaign.") + boosting_profile: BoostingProfile = Field(description="The boosting profile configuration.", alias="boostingProfile") + boosting_control_mode: BoostingControlMode = Field(description="The boosting control mode.", alias="boostingControlMode") + has_booster: StrictBool = Field(description="Whether the campaign has a booster.", alias="hasBooster") + boost_level: StrictInt = Field(description="The campaign's effective boost level (0-10). 0 when no boost is active. Lets clients render and edit the level without unpacking the boosting profile.", alias="boostLevel") + sticky_config: StickyConfig = Field(description="The sticky behavior configuration.", alias="stickyConfig") + filters: List[ICampaignFilter] + feature_flags: List[FeatureFlag] = Field(alias="featureFlags") + owner_mail: StrictStr = Field(description="The email of the campaign owner.", alias="ownerMail") + organization_id: Optional[StrictStr] = Field(default=None, description="The id of the organization that owns the campaign.", alias="organizationId") + created_at: datetime = Field(description="The timestamp when the campaign was created.", alias="createdAt") + version: StrictInt = Field(description="The program's current version, for optimistic concurrency on save.") + root_node_id: StrictStr = Field(description="The node the program's evaluation enters at.", alias="rootNodeId") + nodes: Dict[str, IProgramNode] = Field(description="The program's decision graph, keyed by node id.") + max_rapids: StrictInt = Field(description="The session ends after this many counted responses.", alias="maxRapids") + max_duration_seconds: StrictInt = Field(description="The session ends after this many seconds.", alias="maxDurationSeconds") + __properties: ClassVar[List[str]] = ["_t", "id", "name", "status", "priority", "boostingProfile", "boostingControlMode", "hasBooster", "boostLevel", "stickyConfig", "filters", "featureFlags", "ownerMail", "organizationId", "createdAt", "version", "rootNodeId", "nodes", "maxRapids", "maxDurationSeconds"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ProgramCampaign']): + raise ValueError("must be one of enum values ('ProgramCampaign')") + return value + + # model_config is inherited from LazyValidatedModel + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of boosting_profile + if self.boosting_profile: + _dict['boostingProfile'] = self.boosting_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of sticky_config + if self.sticky_config: + _dict['stickyConfig'] = self.sticky_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item_filters in self.filters: + if _item_filters: + _items.append(_item_filters.to_dict()) + _dict['filters'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list) + _items = [] + if self.feature_flags: + for _item_feature_flags in self.feature_flags: + if _item_feature_flags: + _items.append(_item_feature_flags.to_dict()) + _dict['featureFlags'] = _items + # override the default output from pydantic by calling `to_dict()` of each value in nodes (dict) + _field_dict = {} + if self.nodes: + for _key_nodes in self.nodes: + if self.nodes[_key_nodes]: + _field_dict[_key_nodes] = self.nodes[_key_nodes].to_dict() + _dict['nodes'] = _field_dict + # set to None if organization_id (nullable) is None + # and model_fields_set contains the field + if self.organization_id is None and "organization_id" in self.model_fields_set: + _dict['organizationId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _data = { + "_t": obj.get("_t"), + "id": obj.get("id"), + "name": obj.get("name"), + "status": obj.get("status"), + "priority": obj.get("priority"), + "boostingProfile": BoostingProfile.from_dict(obj["boostingProfile"]) if obj.get("boostingProfile") is not None else None, + "boostingControlMode": obj.get("boostingControlMode"), + "hasBooster": obj.get("hasBooster"), + "boostLevel": obj.get("boostLevel"), + "stickyConfig": StickyConfig.from_dict(obj["stickyConfig"]) if obj.get("stickyConfig") is not None else None, + "filters": [ICampaignFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, + "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None, + "ownerMail": obj.get("ownerMail"), + "organizationId": obj.get("organizationId"), + "createdAt": obj.get("createdAt"), + "version": obj.get("version"), + "rootNodeId": obj.get("rootNodeId"), + "nodes": dict( + (_k, IProgramNode.from_dict(_v)) + for _k, _v in obj["nodes"].items() + ) + if obj.get("nodes") is not None + else None, + "maxRapids": obj.get("maxRapids"), + "maxDurationSeconds": obj.get("maxDurationSeconds") + } + try: + _obj = cls.model_validate(_data) + except ValidationError as _val_error: + _obj = cls._lazy_construct(_data, _val_error) + return _obj + + diff --git a/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_routed_campaign_details.py b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_routed_campaign_details.py new file mode 100644 index 000000000..d2a3e7127 --- /dev/null +++ b/src/rapidata/api_client/models/get_campaign_by_id_endpoint_i_campaign_details_get_campaign_by_id_endpoint_routed_campaign_details.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +""" + Rapidata Asset API + + The API for the Rapidata Asset service + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from rapidata.api_client.models.boosting_control_mode import BoostingControlMode +from rapidata.api_client.models.boosting_profile import BoostingProfile +from rapidata.api_client.models.campaign_status import CampaignStatus +from rapidata.api_client.models.feature_flag import FeatureFlag +from rapidata.api_client.models.i_campaign_filter import ICampaignFilter +from rapidata.api_client.models.i_campaign_selection import ICampaignSelection +from rapidata.api_client.models.sticky_config import StickyConfig +from pydantic import ValidationError +from rapidata.api_client.lazy_model import LazyValidatedModel +from typing import Optional, Set +from typing_extensions import Self + +class GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails(LazyValidatedModel): + """ + A routed campaign: its rapids are served from a fixed selection list. + """ # noqa: E501 + t: StrictStr = Field(alias="_t") + id: StrictStr = Field(description="The unique identifier of the campaign.") + name: StrictStr = Field(description="The name of the campaign.") + status: CampaignStatus = Field(description="The current status of the campaign.") + priority: StrictInt = Field(description="The priority level of the campaign.") + boosting_profile: BoostingProfile = Field(description="The boosting profile configuration.", alias="boostingProfile") + boosting_control_mode: BoostingControlMode = Field(description="The boosting control mode.", alias="boostingControlMode") + has_booster: StrictBool = Field(description="Whether the campaign has a booster.", alias="hasBooster") + boost_level: StrictInt = Field(description="The campaign's effective boost level (0-10). 0 when no boost is active. Lets clients render and edit the level without unpacking the boosting profile.", alias="boostLevel") + sticky_config: StickyConfig = Field(description="The sticky behavior configuration.", alias="stickyConfig") + filters: List[ICampaignFilter] + selections: List[ICampaignSelection] + feature_flags: List[FeatureFlag] = Field(alias="featureFlags") + owner_mail: StrictStr = Field(description="The email of the campaign owner.", alias="ownerMail") + organization_id: Optional[StrictStr] = Field(default=None, description="The id of the organization that owns the campaign.", alias="organizationId") + created_at: datetime = Field(description="The timestamp when the campaign was created.", alias="createdAt") + __properties: ClassVar[List[str]] = ["_t", "id", "name", "status", "priority", "boostingProfile", "boostingControlMode", "hasBooster", "boostLevel", "stickyConfig", "filters", "selections", "featureFlags", "ownerMail", "organizationId", "createdAt"] + + @field_validator('t') + def t_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['RoutedCampaign']): + raise ValueError("must be one of enum values ('RoutedCampaign')") + return value + + # model_config is inherited from LazyValidatedModel + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of boosting_profile + if self.boosting_profile: + _dict['boostingProfile'] = self.boosting_profile.to_dict() + # override the default output from pydantic by calling `to_dict()` of sticky_config + if self.sticky_config: + _dict['stickyConfig'] = self.sticky_config.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in filters (list) + _items = [] + if self.filters: + for _item_filters in self.filters: + if _item_filters: + _items.append(_item_filters.to_dict()) + _dict['filters'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in selections (list) + _items = [] + if self.selections: + for _item_selections in self.selections: + if _item_selections: + _items.append(_item_selections.to_dict()) + _dict['selections'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list) + _items = [] + if self.feature_flags: + for _item_feature_flags in self.feature_flags: + if _item_feature_flags: + _items.append(_item_feature_flags.to_dict()) + _dict['featureFlags'] = _items + # set to None if organization_id (nullable) is None + # and model_fields_set contains the field + if self.organization_id is None and "organization_id" in self.model_fields_set: + _dict['organizationId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _data = { + "_t": obj.get("_t"), + "id": obj.get("id"), + "name": obj.get("name"), + "status": obj.get("status"), + "priority": obj.get("priority"), + "boostingProfile": BoostingProfile.from_dict(obj["boostingProfile"]) if obj.get("boostingProfile") is not None else None, + "boostingControlMode": obj.get("boostingControlMode"), + "hasBooster": obj.get("hasBooster"), + "boostLevel": obj.get("boostLevel"), + "stickyConfig": StickyConfig.from_dict(obj["stickyConfig"]) if obj.get("stickyConfig") is not None else None, + "filters": [ICampaignFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, + "selections": [ICampaignSelection.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None, + "featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None, + "ownerMail": obj.get("ownerMail"), + "organizationId": obj.get("organizationId"), + "createdAt": obj.get("createdAt") + } + try: + _obj = cls.model_validate(_data) + except ValidationError as _val_error: + _obj = cls._lazy_construct(_data, _val_error) + return _obj + + diff --git a/src/rapidata/api_client_README.md b/src/rapidata/api_client_README.md index 148745121..363e25f6a 100644 --- a/src/rapidata/api_client_README.md +++ b/src/rapidata/api_client_README.md @@ -611,6 +611,9 @@ Class | Method | HTTP request | Description - [GetBoostInsightsEndpointOutput](rapidata/api_client/docs/GetBoostInsightsEndpointOutput.md) - [GetBoostStatusEndpointOutput](rapidata/api_client/docs/GetBoostStatusEndpointOutput.md) - [GetBulkReconciliationStatusEndpointOutput](rapidata/api_client/docs/GetBulkReconciliationStatusEndpointOutput.md) + - [GetCampaignByIdEndpointICampaignDetails](rapidata/api_client/docs/GetCampaignByIdEndpointICampaignDetails.md) + - [GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails](rapidata/api_client/docs/GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointProgramCampaignDetails.md) + - [GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails](rapidata/api_client/docs/GetCampaignByIdEndpointICampaignDetailsGetCampaignByIdEndpointRoutedCampaignDetails.md) - [GetCampaignCacheEndpointCampaignEntry](rapidata/api_client/docs/GetCampaignCacheEndpointCampaignEntry.md) - [GetCampaignCacheEndpointOutput](rapidata/api_client/docs/GetCampaignCacheEndpointOutput.md) - [GetCapabilityGranteesEndpointCursorPagedResultOfOutput](rapidata/api_client/docs/GetCapabilityGranteesEndpointCursorPagedResultOfOutput.md) @@ -750,9 +753,6 @@ Class | Method | HTTP request | Description - [IBillingGroupOrderBillingGroup](rapidata/api_client/docs/IBillingGroupOrderBillingGroup.md) - [IBillingGroupRankingFlowBillingGroup](rapidata/api_client/docs/IBillingGroupRankingFlowBillingGroup.md) - [IBillingGroupValidationSetBillingGroup](rapidata/api_client/docs/IBillingGroupValidationSetBillingGroup.md) - - [ICampaignDetails](rapidata/api_client/docs/ICampaignDetails.md) - - [ICampaignDetailsProgramCampaignDetails](rapidata/api_client/docs/ICampaignDetailsProgramCampaignDetails.md) - - [ICampaignDetailsRoutedCampaignDetails](rapidata/api_client/docs/ICampaignDetailsRoutedCampaignDetails.md) - [ICampaignFilter](rapidata/api_client/docs/ICampaignFilter.md) - [ICampaignFilterAndFilter](rapidata/api_client/docs/ICampaignFilterAndFilter.md) - [ICampaignFilterAudienceStateFilter](rapidata/api_client/docs/ICampaignFilterAudienceStateFilter.md)