Class: Google::Apis::BusinessprofileperformanceV1::BusinessProfilePerformanceService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/businessprofileperformance_v1/service.rb

Overview

Business Profile Performance API

The Business Profile Performance API allows merchants to fetch performance reports about their business profile on Google.

Examples:

require 'google/apis/businessprofileperformance_v1'

Businessprofileperformance = Google::Apis::BusinessprofileperformanceV1 # Alias the module
service = Businessprofileperformance::BusinessProfilePerformanceService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBusinessProfilePerformanceService

Returns a new instance of BusinessProfilePerformanceService.



46
47
48
49
50
51
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 46

def initialize
  super('https://businessprofileperformance.googleapis.com/', '',
        client_name: 'google-apis-businessprofileperformance_v1',
        client_version: Google::Apis::BusinessprofileperformanceV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



39
40
41
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 39

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



44
45
46
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#get_location_daily_metrics_time_series(name, daily_metric: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, daily_sub_entity_type_day_of_week: nil, daily_sub_entity_type_time_of_day_hours: nil, daily_sub_entity_type_time_of_day_minutes: nil, daily_sub_entity_type_time_of_day_nanos: nil, daily_sub_entity_type_time_of_day_seconds: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse

Returns the values for each date from a given time range that are associated with the specific daily metric. Example request: GET https:// businessprofileperformance.googleapis.com/v1/locations/12345: getDailyMetricsTimeSeries?dailyMetric=WEBSITE_CLICKS&daily_range.start_date. year=2022&daily_range.start_date.month=1&daily_range.start_date.day=1& daily_range.end_date.year=2022&daily_range.end_date.month=3&daily_range. end_date.day=31

Parameters:

  • name (String)

    Required. The location for which the time series should be fetched. Format: locations/location_id where location_id is an unobfuscated listing id.

  • daily_metric (String) (defaults to: nil)

    Required. The metric to retrieve time series.

  • daily_range_end_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • daily_range_end_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • daily_range_end_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • daily_range_start_date_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • daily_range_start_date_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • daily_range_start_date_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • daily_sub_entity_type_day_of_week (String) (defaults to: nil)

    Represents the day of the week. Eg: MONDAY.

  • daily_sub_entity_type_time_of_day_hours (Fixnum) (defaults to: nil)

    Hours of day in 24 hour format. Should be from 0 to 23. An API may choose to allow the value "24:00:00" for scenarios like business closing time.

  • daily_sub_entity_type_time_of_day_minutes (Fixnum) (defaults to: nil)

    Minutes of hour of day. Must be from 0 to 59.

  • daily_sub_entity_type_time_of_day_nanos (Fixnum) (defaults to: nil)

    Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.

  • daily_sub_entity_type_time_of_day_seconds (Fixnum) (defaults to: nil)

    Seconds of minutes of the time. Must normally be from 0 to 59. An API may allow the value 60 if it allows leap-seconds.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 112

def get_location_daily_metrics_time_series(name, daily_metric: nil, daily_range_end_date_day: nil, daily_range_end_date_month: nil, daily_range_end_date_year: nil, daily_range_start_date_day: nil, daily_range_start_date_month: nil, daily_range_start_date_year: nil, daily_sub_entity_type_day_of_week: nil, daily_sub_entity_type_time_of_day_hours: nil, daily_sub_entity_type_time_of_day_minutes: nil, daily_sub_entity_type_time_of_day_nanos: nil, daily_sub_entity_type_time_of_day_seconds: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}:getDailyMetricsTimeSeries', options)
  command.response_representation = Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse::Representation
  command.response_class = Google::Apis::BusinessprofileperformanceV1::GetDailyMetricsTimeSeriesResponse
  command.params['name'] = name unless name.nil?
  command.query['dailyMetric'] = daily_metric unless daily_metric.nil?
  command.query['dailyRange.endDate.day'] = daily_range_end_date_day unless daily_range_end_date_day.nil?
  command.query['dailyRange.endDate.month'] = daily_range_end_date_month unless daily_range_end_date_month.nil?
  command.query['dailyRange.endDate.year'] = daily_range_end_date_year unless daily_range_end_date_year.nil?
  command.query['dailyRange.startDate.day'] = daily_range_start_date_day unless daily_range_start_date_day.nil?
  command.query['dailyRange.startDate.month'] = daily_range_start_date_month unless daily_range_start_date_month.nil?
  command.query['dailyRange.startDate.year'] = daily_range_start_date_year unless daily_range_start_date_year.nil?
  command.query['dailySubEntityType.dayOfWeek'] = daily_sub_entity_type_day_of_week unless daily_sub_entity_type_day_of_week.nil?
  command.query['dailySubEntityType.timeOfDay.hours'] = daily_sub_entity_type_time_of_day_hours unless daily_sub_entity_type_time_of_day_hours.nil?
  command.query['dailySubEntityType.timeOfDay.minutes'] = daily_sub_entity_type_time_of_day_minutes unless daily_sub_entity_type_time_of_day_minutes.nil?
  command.query['dailySubEntityType.timeOfDay.nanos'] = daily_sub_entity_type_time_of_day_nanos unless daily_sub_entity_type_time_of_day_nanos.nil?
  command.query['dailySubEntityType.timeOfDay.seconds'] = daily_sub_entity_type_time_of_day_seconds unless daily_sub_entity_type_time_of_day_seconds.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_location_searchkeyword_impression_monthlies(parent, monthly_range_end_month_day: nil, monthly_range_end_month_month: nil, monthly_range_end_month_year: nil, monthly_range_start_month_day: nil, monthly_range_start_month_month: nil, monthly_range_start_month_year: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse

Returns the search keywords used to find a business in search or maps. Each search keyword is accompanied by impressions which are aggregated on a monthly basis. Example request: GET https://businessprofileperformance.googleapis.com/ v1/locations/12345/searchkeywords/impressions/monthly?monthly_range. start_month.year=2022&monthly_range.start_month.month=1&monthly_range. end_month.year=2022&monthly_range.end_month.month=3

Parameters:

  • parent (String)

    Required. The location for which the time series should be fetched. Format: locations/location_id where location_id is an unobfuscated listing id.

  • monthly_range_end_month_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • monthly_range_end_month_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • monthly_range_end_month_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • monthly_range_start_month_day (Fixnum) (defaults to: nil)

    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.

  • monthly_range_start_month_month (Fixnum) (defaults to: nil)

    Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.

  • monthly_range_start_month_year (Fixnum) (defaults to: nil)

    Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.

  • page_size (Fixnum) (defaults to: nil)

    Optional. The number of results requested. The default page size is 100. Page size can be set to a maximum of 100.

  • page_token (String) (defaults to: nil)

    Optional. A token indicating the next paginated result to be returned.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/google/apis/businessprofileperformance_v1/service.rb', line 183

def list_location_searchkeyword_impression_monthlies(parent, monthly_range_end_month_day: nil, monthly_range_end_month_month: nil, monthly_range_end_month_year: nil, monthly_range_start_month_day: nil, monthly_range_start_month_month: nil, monthly_range_start_month_year: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/searchkeywords/impressions/monthly', options)
  command.response_representation = Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse::Representation
  command.response_class = Google::Apis::BusinessprofileperformanceV1::ListSearchKeywordImpressionsMonthlyResponse
  command.params['parent'] = parent unless parent.nil?
  command.query['monthlyRange.endMonth.day'] = monthly_range_end_month_day unless monthly_range_end_month_day.nil?
  command.query['monthlyRange.endMonth.month'] = monthly_range_end_month_month unless monthly_range_end_month_month.nil?
  command.query['monthlyRange.endMonth.year'] = monthly_range_end_month_year unless monthly_range_end_month_year.nil?
  command.query['monthlyRange.startMonth.day'] = monthly_range_start_month_day unless monthly_range_start_month_day.nil?
  command.query['monthlyRange.startMonth.month'] = monthly_range_start_month_month unless monthly_range_start_month_month.nil?
  command.query['monthlyRange.startMonth.year'] = monthly_range_start_month_year unless monthly_range_start_month_year.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end