def request_reference_portfolio_creation(reference_portfolio_code, portfolio_creation_date, analyst_scope_code, api_factory): # Create the request to add our portfolio reference_portfolio_request = models.CreateReferencePortfolioRequest( display_name=reference_portfolio_code, code=reference_portfolio_code, description='Paper reference portfolio', created=portfolio_creation_date) # Call LUSID to create our reference portfolio portfolio_response = api_factory.build( lusid.api.ReferencePortfolioApi).create_reference_portfolio( scope=analyst_scope_code, create_reference_portfolio_request=reference_portfolio_request) # Pretty print our response from LUSID prettyprint.portfolio_response(portfolio_response)
def request_transaction_portfolio_creation(portfolio_code, portfolio_creation_date, analyst_scope_code, description, api_factory): # Create the request to add our portfolio transaction_portfolio_request = models.CreateTransactionPortfolioRequest( display_name=portfolio_code, code=portfolio_code, base_currency='GBP', description='Paper transaction portfolio', created=portfolio_creation_date) # Call LUSID to create our portfolio portfolio_response = api_factory.build( lusid.api.TransactionPortfoliosApi).create_portfolio( scope=analyst_scope_code, create_transaction_portfolio_request=transaction_portfolio_request) # Pretty print the response from LUSID prettyprint.portfolio_response(portfolio_response)