Closed scott-fehrman-sp closed 2 weeks ago
Testing with version 1.1.8 ... getting a different error message:
Multiple matches found when deserializing the JSON string into GetActiveCampaigns200ResponseInner with oneOf schemas: Campaign, SlimCampaign.
This one is fixed in https://github.com/sailpoint-oss/python-sdk/commit/4cb94f6e6840867ae7f872c1d4ffa812ba914ace and will be a part of the next release!
Here is an example code snippet that would function the same as yours above:
from typing import List
import sailpoint.v3
import sailpoint.beta
import json
from sailpoint.configuration import Configuration
from pydantic import StrictStr
configuration = Configuration()
results: List[sailpoint.v3.GetActiveCampaigns200ResponseInner] = None
result: sailpoint.v3.GetActiveCampaigns200ResponseInner = None
with sailpoint.v3.ApiClient(configuration) as api_client:
results = sailpoint.v3.CertificationCampaignsApi(api_client).get_active_campaigns()
for campaign in results:
instance = campaign.actual_instance
str_camp = instance.model_dump_json(by_alias=True)
json_camp = json.loads(str_camp)
print(f"Json: {json.dumps(json_camp, indent=2)}")
Run:
python3 test_CertificationCampaigns.py
Output: