|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Segment Public API |
| 5 | +
|
| 6 | + The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API. |
| 7 | +
|
| 8 | + The version of the OpenAPI document: 59.1.0 |
| 9 | + |
| 10 | + Generated by OpenAPI Generator (https://openapi-generator.tech) |
| 11 | +
|
| 12 | + Do not edit the class manually. |
| 13 | +""" # noqa: E501 |
| 14 | + |
| 15 | + |
| 16 | +from __future__ import annotations |
| 17 | +import pprint |
| 18 | +import re # noqa: F401 |
| 19 | +import json |
| 20 | + |
| 21 | + |
| 22 | +from typing import Optional |
| 23 | +from pydantic import BaseModel, Field, StrictBool, StrictStr |
| 24 | +from segment_public_api.models.destination_subscription_configuration import DestinationSubscriptionConfiguration |
| 25 | +from segment_public_api.models.personalization_input import PersonalizationInput |
| 26 | + |
| 27 | +class ActivationOutput(BaseModel): |
| 28 | + """ |
| 29 | + A class that encapsulates the complete activation output with full details. # noqa: E501 |
| 30 | + """ |
| 31 | + id: StrictStr = Field(..., description="The activation id.") |
| 32 | + enabled: StrictBool = Field(..., description="Activation Enabled Status.") |
| 33 | + workspace_id: StrictStr = Field(..., alias="workspaceId", description="The WORKSPACE id.") |
| 34 | + space_id: StrictStr = Field(..., alias="spaceId", description="The space id.") |
| 35 | + audience_id: StrictStr = Field(..., alias="audienceId", description="The audience id.") |
| 36 | + destination_connection_id: StrictStr = Field(..., alias="destinationConnectionId", description="The DESTINATION connection id (formerly integrationInstanceId).") |
| 37 | + activation_type: StrictStr = Field(..., alias="activationType", description="Type of activation trigger.") |
| 38 | + activation_name: StrictStr = Field(..., alias="activationName", description="Name of the activation.") |
| 39 | + personalization: PersonalizationInput = Field(...) |
| 40 | + destination_mapping: DestinationSubscriptionConfiguration = Field(..., alias="destinationMapping") |
| 41 | + perform_resync: Optional[StrictBool] = Field(None, alias="performResync", description="Whether to perform a resync after creation of the activation.") |
| 42 | + __properties = ["id", "enabled", "workspaceId", "spaceId", "audienceId", "destinationConnectionId", "activationType", "activationName", "personalization", "destinationMapping", "performResync"] |
| 43 | + |
| 44 | + class Config: |
| 45 | + """Pydantic configuration""" |
| 46 | + allow_population_by_field_name = True |
| 47 | + validate_assignment = True |
| 48 | + |
| 49 | + def to_str(self) -> str: |
| 50 | + """Returns the string representation of the model using alias""" |
| 51 | + return pprint.pformat(self.dict(by_alias=True)) |
| 52 | + |
| 53 | + def to_json(self) -> str: |
| 54 | + """Returns the JSON representation of the model using alias""" |
| 55 | + return json.dumps(self.to_dict()) |
| 56 | + |
| 57 | + @classmethod |
| 58 | + def from_json(cls, json_str: str) -> ActivationOutput: |
| 59 | + """Create an instance of ActivationOutput from a JSON string""" |
| 60 | + return cls.from_dict(json.loads(json_str)) |
| 61 | + |
| 62 | + def to_dict(self): |
| 63 | + """Returns the dictionary representation of the model using alias""" |
| 64 | + _dict = self.dict(by_alias=True, |
| 65 | + exclude={ |
| 66 | + }, |
| 67 | + exclude_none=True) |
| 68 | + # override the default output from pydantic by calling `to_dict()` of personalization |
| 69 | + if self.personalization: |
| 70 | + _dict['personalization'] = self.personalization.to_dict() |
| 71 | + # override the default output from pydantic by calling `to_dict()` of destination_mapping |
| 72 | + if self.destination_mapping: |
| 73 | + _dict['destinationMapping'] = self.destination_mapping.to_dict() |
| 74 | + return _dict |
| 75 | + |
| 76 | + @classmethod |
| 77 | + def from_dict(cls, obj: dict) -> ActivationOutput: |
| 78 | + """Create an instance of ActivationOutput from a dict""" |
| 79 | + if obj is None: |
| 80 | + return None |
| 81 | + |
| 82 | + if not isinstance(obj, dict): |
| 83 | + return ActivationOutput.parse_obj(obj) |
| 84 | + |
| 85 | + _obj = ActivationOutput.parse_obj({ |
| 86 | + "id": obj.get("id"), |
| 87 | + "enabled": obj.get("enabled"), |
| 88 | + "workspace_id": obj.get("workspaceId"), |
| 89 | + "space_id": obj.get("spaceId"), |
| 90 | + "audience_id": obj.get("audienceId"), |
| 91 | + "destination_connection_id": obj.get("destinationConnectionId"), |
| 92 | + "activation_type": obj.get("activationType"), |
| 93 | + "activation_name": obj.get("activationName"), |
| 94 | + "personalization": PersonalizationInput.from_dict(obj.get("personalization")) if obj.get("personalization") is not None else None, |
| 95 | + "destination_mapping": DestinationSubscriptionConfiguration.from_dict(obj.get("destinationMapping")) if obj.get("destinationMapping") is not None else None, |
| 96 | + "perform_resync": obj.get("performResync") |
| 97 | + }) |
| 98 | + return _obj |
| 99 | + |
| 100 | + |
0 commit comments