def main(client, order_id):
  # Initialize appropriate service.
  order_service = client.GetService('OrderService', version='v201511')

  # Create statement object to select a single order by an ID.
  values = [{
      'key': 'orderId',
      'value': {
          'xsi_type': 'NumberValue',
          'value': order_id
      }
  }]
  query = 'WHERE id = :orderId'

  statement = dfp.FilterStatement(query, values)

  # Get orders by statement.
  response = order_service.getOrdersByStatement(statement.ToStatement())

  if 'results' in response:
    # Update each local order object by changing its notes.
    updated_orders = []
    for order in response['results']:
      # Archived orders cannot be updated.
      if not order['isArchived']:
        order['notes'] = 'Spoke to advertiser. All is well.'
        updated_orders.append(order)

    # Update orders remotely.
    orders = order_service.updateOrders(updated_orders)

    # Display results.
    if orders:
      for order in orders:
        print ('Order with id \'%s\', name \'%s\', advertiser id \'%s\', and '
               'notes \'%s\' was updated.'
               % (order['id'], order['name'], order['advertiserId'],
                  order['notes']))
    else:
      print 'No orders were updated.'
  else:
    print 'No orders found to update.'
dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201511/order_service/update_orders.py/main/original