Search code examples
javagoogle-my-business-apigoogle-my-business

how to Update attributes for a given location in java using new API Google mybusiness information


Using this link: Method: locations.updateAttributes , I need to do updateAttributes for every location I have in google mybusiness information API. I cannot find any code example. Would anyone please provide some codes? Thanks a million


Solution

  • I get that Attributes vs List<Attribute> might be confusing. This should help:

     public void updateAttributes(String attributePath, List<Attribute> attributes, 
        String attributeMask) {
    
        UpdateAttributes request = myBusinessBusinessInformation.locations()
            .updateAttributes(attributePath, new Attributes().setAttributes(attributes))
            .setAttributeMask(attributeMask);
    
           request.execute();
    }