Class: Google::Apis::MybusinessV3::Location

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/mybusiness_v3/classes.rb,
generated/google/apis/mybusiness_v3/representations.rb,
generated/google/apis/mybusiness_v3/representations.rb

Overview

A location. See the help center article for a detailed description of these fields, or the [category list](/my-business/content/categories] for a list of valid business categories.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Location

Returns a new instance of Location.



449
450
451
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 449

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#ad_words_location_extensionsGoogle::Apis::MybusinessV3::AdWordsLocationExtensions

Additional information that is surfaced in AdWords. Corresponds to the JSON property adWordsLocationExtensions



372
373
374
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 372

def ad_words_location_extensions
  @ad_words_location_extensions
end

#additional_categoriesArray<Google::Apis::MybusinessV3::Category>

Additional categories to describe your business. Categories help your customers find accurate, specific results for services they're interested in. In order to keep your business information accurate and live, make sure that you use as few categories as possible to describe your overall core business. Choose categories that are as specific as possible, but representative of your main business. Corresponds to the JSON property additionalCategories



329
330
331
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 329

def additional_categories
  @additional_categories
end

#additional_phonesArray<String>

Up to two phone numbers (mobile or landline, no fax) at which your business can be called, in addition to your primary phone number. Corresponds to the JSON property additionalPhones

Returns:

  • (Array<String>)


294
295
296
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 294

def additional_phones
  @additional_phones
end

#addressGoogle::Apis::MybusinessV3::Address

Represents the physical location of the business. Example addresses: address_lines: "1600 Amphitheatre Parkway" locality: Mountain View administrative_area: CA country: US postal_code: 94043 address_lines: "A-205, Natasha Apartments", "2, Inner Ring Road" sub_locality: Domlur locality: Bangalore administrative_area: Karnataka country: IN postal_code: 560071 Corresponds to the JSON property address



311
312
313
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 311

def address
  @address
end

#attributesArray<Google::Apis::MybusinessV3::Attribute>

Attributes for this location. Corresponds to the JSON property attributes



442
443
444
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 442

def attributes
  @attributes
end

#labelsArray<String>

A collection of free-form strings to allow you to tag your business. These labels are NOT user facing, and are only be seen by you. Limited to 255 characters (per label). Corresponds to the JSON property labels

Returns:

  • (Array<String>)


367
368
369
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 367

def labels
  @labels
end

#latlngGoogle::Apis::MybusinessV3::LatLng

An object representing a latitude/longitude pair. This is expressed as a pair of doubles representing degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. Example of normalization code in Python: def NormalizeLongitude(longitude): """Wraps decimal degrees longitude to [-180.0, 180.0].""" q, r = divmod(longitude, 360.0) if r > 180.0 or (r == 180.0 and q <= -1.0): return r - 360.0 return r def NormalizeLatLng(latitude, longitude): """Wraps decimal degrees latitude and longitude to [-90.0, 90.0] and [-180.0, 180.0], respectively.""" r = latitude % 360.0 if r <= 90.0: return r, NormalizeLongitude(longitude) elif r >= 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) Corresponds to the JSON property latlng



426
427
428
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 426

def latlng
  @latlng
end

#location_keyGoogle::Apis::MybusinessV3::LocationKey

Alternate / surrogate key references for a location. Corresponds to the JSON property locationKey



360
361
362
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 360

def location_key
  @location_key
end

#location_nameString

Location name should reflect your business's real-world name, as used consistently on your storefront, website, and stationery, and as known to customers. Any additional information, when relevant, can be included in other fields of the resource (for example, Address, Categories). Do not add unnecessary information to your name (for example, prefer "Google" over "Google Inc. - Mountain View Corporate Headquarters"). It is NOT permitted to include marketing taglines, store codes, special characters, hours or closed/open status, phone numbers, website URLs, service/product information, location/address or directions, or containment information (for example, "Chase ATM in Duane Reade"). Corresponds to the JSON property locationName

Returns:

  • (String)


281
282
283
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 281

def location_name
  @location_name
end

#location_stateGoogle::Apis::MybusinessV3::LocationState

Contains a set of booleans that reflect the state of a Location. Corresponds to the JSON property locationState



437
438
439
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 437

def location_state
  @location_state
end

#metadataGoogle::Apis::MybusinessV3::Metadata

Additional non-user-editable information about the location. Corresponds to the JSON property metadata



447
448
449
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 447

def 
  @metadata
end

#nameString

Google identifier for this location in the form: accounts/account_id/locations/location_id` In the context of matches, this field will not be populated. Corresponds to the JSON propertyname`

Returns:

  • (String)


258
259
260
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 258

def name
  @name
end

#open_infoGoogle::Apis::MybusinessV3::OpenInfo

Indicates whether the location is currently open for business. All locations are open by default, unless updated to be closed. Corresponds to the JSON property openInfo



432
433
434
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 432

def open_info
  @open_info
end

#photosGoogle::Apis::MybusinessV3::Photos

A collection of photos representing the business, categorized by photo type. The URL for each photo should point to a publicly accessible image. Photos should be supplied in either JPG or PNG format unless specified otherwise. If the photo was added by using Google My Business Locations or this API, the user-provided URL is used. If the photo was uploaded via the Google My Business Photos App, the photo uses a generated URL hosted by Google. Exceptions: profile_photo_url and cover_photo_url are always under a Google domain. With the exception of profile_photo_url and cover_photo_url, all photos must measure a minimum of 250px on the short edge, with a file size of at least 10240 bytes. Corresponds to the JSON property photos



387
388
389
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 387

def photos
  @photos
end

#primary_categoryGoogle::Apis::MybusinessV3::Category

A category describing what this business is (not what it does). For a list of valid category IDs, and the mappings to their human readable names, see the category list. Corresponds to the JSON property primaryCategory



318
319
320
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 318

def primary_category
  @primary_category
end

#primary_phoneString

A phone number that connects to your individual business location as directly as possible. Use a local phone number instead of a central, call center helpline number whenever possible. Corresponds to the JSON property primaryPhone

Returns:

  • (String)


288
289
290
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 288

def primary_phone
  @primary_phone
end

#regular_hoursGoogle::Apis::MybusinessV3::BusinessHours

Represents the time periods that this location is open for business. Holds a collection of TimePeriod instances. Corresponds to the JSON property regularHours



343
344
345
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 343

def regular_hours
  @regular_hours
end

#service_areaGoogle::Apis::MybusinessV3::ServiceAreaBusiness

Service area businesses provide their service at the customer's location (for example a locksmith or plumber). Corresponds to the JSON property serviceArea



355
356
357
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 355

def service_area
  @service_area
end

#special_hoursGoogle::Apis::MybusinessV3::SpecialHours

Represents a set of time periods when a location's operational hours differ from its normal business hours. Corresponds to the JSON property specialHours



349
350
351
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 349

def special_hours
  @special_hours
end

#store_codeString

External identifier for this location, which must be unique inside a given account. This is a means of associating the location with your own records. Corresponds to the JSON property storeCode

Returns:

  • (String)


264
265
266
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 264

def store_code
  @store_code
end

#website_urlString

A URL for this business. If possible, use a URL that represents this individual business location instead of a generic website/URL that represents all locations, or the brand. Corresponds to the JSON property websiteUrl

Returns:

  • (String)


336
337
338
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 336

def website_url
  @website_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 454

def update!(**args)
  @name = args[:name] if args.key?(:name)
  @store_code = args[:store_code] if args.key?(:store_code)
  @location_name = args[:location_name] if args.key?(:location_name)
  @primary_phone = args[:primary_phone] if args.key?(:primary_phone)
  @additional_phones = args[:additional_phones] if args.key?(:additional_phones)
  @address = args[:address] if args.key?(:address)
  @primary_category = args[:primary_category] if args.key?(:primary_category)
  @additional_categories = args[:additional_categories] if args.key?(:additional_categories)
  @website_url = args[:website_url] if args.key?(:website_url)
  @regular_hours = args[:regular_hours] if args.key?(:regular_hours)
  @special_hours = args[:special_hours] if args.key?(:special_hours)
  @service_area = args[:service_area] if args.key?(:service_area)
  @location_key = args[:location_key] if args.key?(:location_key)
  @labels = args[:labels] if args.key?(:labels)
  @ad_words_location_extensions = args[:ad_words_location_extensions] if args.key?(:ad_words_location_extensions)
  @photos = args[:photos] if args.key?(:photos)
  @latlng = args[:latlng] if args.key?(:latlng)
  @open_info = args[:open_info] if args.key?(:open_info)
  @location_state = args[:location_state] if args.key?(:location_state)
  @attributes = args[:attributes] if args.key?(:attributes)
  @metadata = args[:metadata] if args.key?(:metadata)
end