def create_feed_items(client, customer_id, feed_details, label):
    """Creates feed items with the given feed_details and label.

    Args:
        client: an initialized GoogleAdsClient instance.
        customer_id: a client customer ID str.
        feed_details: a FeedDetails instance with feed attribute information
        label: a Dynamic Search Ad URL label str.
    """
    # See https://support.google.com/adwords/answer/7166527 for page feed URL
    # recommendations and rules.
    urls = [
        "http://www.example.com/discounts/rental-cars",
        "http://www.example.com/discounts/hotel-deals",
        "http://www.example.com/discounts/flight-deals",
    ]

    def map_feed_urls(url):
        feed_item_operation = client.get_type("FeedItemOperation", version="v6")
        feed_item = feed_item_operation.create
        feed_item.feed = feed_details.resource_name

        url_attribute_value = client.get_type(
            "FeedItemAttributeValue", version="v6"
        )
        url_attribute_value.feed_attribute_id = feed_details.url_attribute_id
        url_attribute_value.string_values.append(url)
        feed_item.attribute_values.append(url_attribute_value)

        label_attribute_value = client.get_type(
            "FeedItemAttributeValue", version="v6"
        )
        label_attribute_value.feed_attribute_id = (
            feed_details.label_attribute_id
        )
        label_attribute_value.string_values.append(label)
        feed_item.attribute_values.append(label_attribute_value)

        return feed_item_operation

    # Create a new feed item operation for each of the URLs in the url list.
    feed_item_operations = list(map(map_feed_urls, urls))

    # Retrieve the feed item service.
    feed_item_service = client.get_service("FeedItemService", version="v6")
    # Submit the feed item operations and add the feed items.
    response = feed_item_service.mutate_feed_items(
        customer_id, feed_item_operations
    )

    # Display the results.
    for feed_item in response.results:
        print(
            "Created feed item with resource_name: # {}".format(
                feed_item.resource_name
            )
        )