-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated build 'Automated commit 'Merge pull request #1727 from sail…
…point/fix/BulkTaggedObjects Update response schema for setting tags to objects in bulk' by github action: 9778860320' python sdk: 9778867399
- Loading branch information
1 parent
5b41bf5
commit 96b971d
Showing
8 changed files
with
199 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# BulkTaggedObjectResponse | ||
|
||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**object_refs** | [**List[TaggedObjectDto]**](TaggedObjectDto.md) | | [optional] | ||
**tags** | **List[str]** | Label to be applied to an Object | [optional] | ||
|
||
## Example | ||
|
||
```python | ||
from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse | ||
|
||
# TODO update the JSON string below | ||
json = "{}" | ||
# create an instance of BulkTaggedObjectResponse from a JSON string | ||
bulk_tagged_object_response_instance = BulkTaggedObjectResponse.from_json(json) | ||
# print the JSON string representation of the object | ||
print BulkTaggedObjectResponse.to_json() | ||
|
||
# convert the object into a dict | ||
bulk_tagged_object_response_dict = bulk_tagged_object_response_instance.to_dict() | ||
# create an instance of BulkTaggedObjectResponse from a dict | ||
bulk_tagged_object_response_form_dict = bulk_tagged_object_response.from_dict(bulk_tagged_object_response_dict) | ||
``` | ||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Identity Security Cloud V3 API | ||
Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. | ||
The version of the OpenAPI document: 3.0.0 | ||
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 typing import Any, ClassVar, Dict, List, Optional | ||
from pydantic import BaseModel, StrictStr | ||
from pydantic import Field | ||
from sailpoint.v3.models.tagged_object_dto import TaggedObjectDto | ||
try: | ||
from typing import Self | ||
except ImportError: | ||
from typing_extensions import Self | ||
|
||
class BulkTaggedObjectResponse(BaseModel): | ||
""" | ||
BulkTaggedObjectResponse | ||
""" # noqa: E501 | ||
object_refs: Optional[List[TaggedObjectDto]] = Field(default=None, alias="objectRefs") | ||
tags: Optional[List[StrictStr]] = Field(default=None, description="Label to be applied to an Object") | ||
__properties: ClassVar[List[str]] = ["objectRefs", "tags"] | ||
|
||
model_config = { | ||
"populate_by_name": True, | ||
"validate_assignment": True, | ||
"protected_namespaces": (), | ||
} | ||
|
||
|
||
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) -> Self: | ||
"""Create an instance of BulkTaggedObjectResponse 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. | ||
""" | ||
_dict = self.model_dump( | ||
by_alias=True, | ||
exclude={ | ||
}, | ||
exclude_none=True, | ||
) | ||
# override the default output from pydantic by calling `to_dict()` of each item in object_refs (list) | ||
_items = [] | ||
if self.object_refs: | ||
for _item in self.object_refs: | ||
if _item: | ||
_items.append(_item.to_dict()) | ||
_dict['objectRefs'] = _items | ||
return _dict | ||
|
||
@classmethod | ||
def from_dict(cls, obj: Dict) -> Self: | ||
"""Create an instance of BulkTaggedObjectResponse from a dict""" | ||
if obj is None: | ||
return None | ||
|
||
if not isinstance(obj, dict): | ||
return cls.model_validate(obj) | ||
|
||
_obj = cls.model_validate({ | ||
"objectRefs": [TaggedObjectDto.from_dict(_item) for _item in obj.get("objectRefs")] if obj.get("objectRefs") is not None else None, | ||
"tags": obj.get("tags") | ||
}) | ||
return _obj | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Identity Security Cloud V3 API | ||
Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs. | ||
The version of the OpenAPI document: 3.0.0 | ||
Generated by OpenAPI Generator (https://openapi-generator.tech) | ||
Do not edit the class manually. | ||
""" # noqa: E501 | ||
|
||
|
||
import unittest | ||
import datetime | ||
|
||
from sailpoint.v3.models.bulk_tagged_object_response import BulkTaggedObjectResponse | ||
|
||
class TestBulkTaggedObjectResponse(unittest.TestCase): | ||
"""BulkTaggedObjectResponse unit test stubs""" | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
def make_instance(self, include_optional) -> BulkTaggedObjectResponse: | ||
"""Test BulkTaggedObjectResponse | ||
include_option is a boolean, when False only required | ||
params are included, when True both required and | ||
optional params are included """ | ||
# uncomment below to create an instance of `BulkTaggedObjectResponse` | ||
""" | ||
model = BulkTaggedObjectResponse() | ||
if include_optional: | ||
return BulkTaggedObjectResponse( | ||
object_refs = [ | ||
sailpoint.v3.models.tagged_object_dto.TaggedObjectDto( | ||
type = 'IDENTITY', | ||
id = '2c91808568c529c60168cca6f90c1313', | ||
name = 'William Wilson', ) | ||
], | ||
tags = [BU_FINANCE, PCI] | ||
) | ||
else: | ||
return BulkTaggedObjectResponse( | ||
) | ||
""" | ||
|
||
def testBulkTaggedObjectResponse(self): | ||
"""Test BulkTaggedObjectResponse""" | ||
# inst_req_only = self.make_instance(include_optional=False) | ||
# inst_req_and_optional = self.make_instance(include_optional=True) | ||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters