예제 #1
0
def request_define_property(domain, scope, code, display_name, api_factory):
    # Create a request to define our strategy property
    property_request = models.CreatePropertyDefinitionRequest(
        domain='Transaction',
        scope=scope,
        code='strategy',
        value_required=False,
        display_name='strategy',
        data_type_id=models.ResourceId(scope='system', code='string'))

    # Call LUSID to create our new property
    property_response = api_factory.build(
        lusid.api.PropertyDefinitionsApi).create_property_definition(
            create_property_definition_request=property_request)

    # Grab the key off the response to use when referencing this property in other LUSID calls
    strategy_property_key = property_response.key

    # Pretty print our strategy property key
    prettyprint.heading('Strategy Property Key: ', strategy_property_key)
    return strategy_property_key
예제 #2
0
def create_analyst_scope():
    # Fetch our scopes
    scope_id = import_data.create_scope_id()
    analyst_scope_code = 'analyst-paper-{}'.format(scope_id)
    prettyprint.heading('Analyst Scope Code', analyst_scope_code)
    return analyst_scope_code