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



1114
1115
1116
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1114

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



921
922
923
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 921

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



932
933
934
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 932

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>)


938
939
940
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 938

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



955
956
957
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 955

def address
  @address
end

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

Attributes for this location. Corresponds to the JSON property attributes



960
961
962
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 960

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>)


967
968
969
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 967

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



1006
1007
1008
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1006

def latlng
  @latlng
end

#location_keyGoogle::Apis::MybusinessV3::LocationKey

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



1011
1012
1013
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1011

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)


1028
1029
1030
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1028

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



1033
1034
1035
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1033

def location_state
  @location_state
end

#metadataGoogle::Apis::MybusinessV3::Metadata

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



1038
1039
1040
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1038

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)


1045
1046
1047
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1045

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



1051
1052
1053
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1051

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



1066
1067
1068
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1066

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



1073
1074
1075
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1073

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)


1080
1081
1082
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1080

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



1087
1088
1089
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1087

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



1093
1094
1095
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1093

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



1099
1100
1101
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1099

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)


1105
1106
1107
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1105

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)


1112
1113
1114
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1112

def website_url
  @website_url
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
# File 'generated/google/apis/mybusiness_v3/classes.rb', line 1119

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