Skip to content

How to use functions from ObjectService #1005

Answered by rkvinoth
wimgielis asked this question in Q&A
Discussion options

You must be logged in to vote

ObjectService requires RestService to get instantiated. So, its not possible to directly use it. But, you can access those methods through CellService or ElementService or SecurityService as the ObjectService is inherited in these services:

from TM1py.Services import TM1Service

credentials = {}

with TM1Service(**credentials) as tm1:
    # To use the suggest_unique_object_name
    print(tm1.cells.suggest_unique_object_name())
    print(tm1.elements.suggest_unique_object_name())
    print(tm1.security.suggest_unique_object_name())

    # To use the determine_actual_object_name you have to pass the object_class and object_name
    print(tm1.cells.determine_actual_object_name(object_class='…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@wimgielis
Comment options

Answer selected by wimgielis
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants