Create Proposal Line Items
Create Proposal Line Items
/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import datetime
import uuid
# Set proposal that the created proposal line item will belong to.
PROPOSAL_ID = 'INSERT_PROPOSAL_ID_HERE'
# Set the ID of the product that the proposal line items should be created from.
PRODUCT_ID = 'INSERT_PRODUCT_ID_HERE'
# Set the ID of the rate card the proposal line items should be priced from.
RATE_CARD_ID = 'INSERT_RATE_CARD_ID_HERE'
start_datetime = datetime.datetime.now(tz=pytz.timezone('America/New_York'))
end_datetime = start_datetime + datetime.timedelta(days=365)
# Display results.
for proposal_line_item in proposal_line_items:
print(('Proposal line item with id "%s", belonging to proposal id "%s"'
', and named "%s" was created.' %
(proposal_line_item['id'], proposal_line_item['proposalId'],
proposal_line_item['name'])))
if __name__ == '__main__':
# Initialize client object.
dfp_client = dfp.DfpClient.LoadFromStorage()
main(dfp_client, PROPOSAL_ID, PRODUCT_ID, RATE_CARD_ID)