# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

require 'date'
require 'google/apis/core/base_service'
require 'google/apis/core/json_representation'
require 'google/apis/core/hashable'
require 'google/apis/errors'

module Google
  module Apis
    module AdsenseV2
      
      # Representation of an account.
      class Account
        include Google::Apis::Core::Hashable
      
        # Output only. Creation time of the account.
        # Corresponds to the JSON property `createTime`
        # @return [String]
        attr_accessor :create_time
      
        # Output only. Display name of this account.
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name
      
        # Output only. Resource name of the account. Format: accounts/pub-[0-9]+
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Outstanding tasks that need to be completed as part of the sign-
        # up process for a new account. e.g. "billing-profile-creation", "phone-pin-
        # verification".
        # Corresponds to the JSON property `pendingTasks`
        # @return [Array<String>]
        attr_accessor :pending_tasks
      
        # Output only. Whether this account is premium. Premium accounts have access to
        # additional spam-related metrics.
        # Corresponds to the JSON property `premium`
        # @return [Boolean]
        attr_accessor :premium
        alias_method :premium?, :premium
      
        # Output only. State of the account.
        # Corresponds to the JSON property `state`
        # @return [String]
        attr_accessor :state
      
        # Represents a time zone from the [IANA Time Zone Database](https://www.iana.org/
        # time-zones).
        # Corresponds to the JSON property `timeZone`
        # @return [Google::Apis::AdsenseV2::TimeZone]
        attr_accessor :time_zone
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @create_time = args[:create_time] if args.key?(:create_time)
          @display_name = args[:display_name] if args.key?(:display_name)
          @name = args[:name] if args.key?(:name)
          @pending_tasks = args[:pending_tasks] if args.key?(:pending_tasks)
          @premium = args[:premium] if args.key?(:premium)
          @state = args[:state] if args.key?(:state)
          @time_zone = args[:time_zone] if args.key?(:time_zone)
        end
      end
      
      # Representation of an ad blocking recovery tag. See https://support.google.com/
      # adsense/answer/11575177.
      class AdBlockingRecoveryTag
        include Google::Apis::Core::Hashable
      
        # Error protection code that can be used in conjunction with the tag. It'll
        # display a message to users if an [ad blocking extension blocks their access to
        # your site](https://support.google.com/adsense/answer/11575480).
        # Corresponds to the JSON property `errorProtectionCode`
        # @return [String]
        attr_accessor :error_protection_code
      
        # The ad blocking recovery tag. Note that the message generated by the tag can
        # be blocked by an ad blocking extension. If this is not your desired outcome,
        # then you'll need to use it in conjunction with the error protection code.
        # Corresponds to the JSON property `tag`
        # @return [String]
        attr_accessor :tag
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @error_protection_code = args[:error_protection_code] if args.key?(:error_protection_code)
          @tag = args[:tag] if args.key?(:tag)
        end
      end
      
      # Representation of an ad client. An ad client represents a user's subscription
      # with a specific AdSense product.
      class AdClient
        include Google::Apis::Core::Hashable
      
        # Output only. Resource name of the ad client. Format: accounts/`account`/
        # adclients/`adclient`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Reporting product code of the ad client. For example, "AFC" for
        # AdSense for Content. Corresponds to the `PRODUCT_CODE` dimension, and present
        # only if the ad client supports reporting.
        # Corresponds to the JSON property `productCode`
        # @return [String]
        attr_accessor :product_code
      
        # Output only. Unique ID of the ad client as used in the `AD_CLIENT_ID`
        # reporting dimension. Present only if the ad client supports reporting.
        # Corresponds to the JSON property `reportingDimensionId`
        # @return [String]
        attr_accessor :reporting_dimension_id
      
        # Output only. State of the ad client.
        # Corresponds to the JSON property `state`
        # @return [String]
        attr_accessor :state
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @name = args[:name] if args.key?(:name)
          @product_code = args[:product_code] if args.key?(:product_code)
          @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
          @state = args[:state] if args.key?(:state)
        end
      end
      
      # Representation of the AdSense code for a given ad client. For more information,
      # see [About the AdSense code](https://support.google.com/adsense/answer/
      # 9274634).
      class AdClientAdCode
        include Google::Apis::Core::Hashable
      
        # Output only. The AdSense code snippet to add to the head of an HTML page.
        # Corresponds to the JSON property `adCode`
        # @return [String]
        attr_accessor :ad_code
      
        # Output only. The AdSense code snippet to add to the body of an AMP page.
        # Corresponds to the JSON property `ampBody`
        # @return [String]
        attr_accessor :amp_body
      
        # Output only. The AdSense code snippet to add to the head of an AMP page.
        # Corresponds to the JSON property `ampHead`
        # @return [String]
        attr_accessor :amp_head
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @ad_code = args[:ad_code] if args.key?(:ad_code)
          @amp_body = args[:amp_body] if args.key?(:amp_body)
          @amp_head = args[:amp_head] if args.key?(:amp_head)
        end
      end
      
      # Representation of an ad unit. An ad unit represents a saved ad unit with a
      # specific set of ad settings that have been customized within an account.
      class AdUnit
        include Google::Apis::Core::Hashable
      
        # Settings specific to content ads (AFC).
        # Corresponds to the JSON property `contentAdsSettings`
        # @return [Google::Apis::AdsenseV2::ContentAdsSettings]
        attr_accessor :content_ads_settings
      
        # Required. Display name of the ad unit, as provided when the ad unit was
        # created.
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name
      
        # Output only. Resource name of the ad unit. Format: accounts/`account`/
        # adclients/`adclient`/adunits/`adunit`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Unique ID of the ad unit as used in the `AD_UNIT_ID` reporting
        # dimension.
        # Corresponds to the JSON property `reportingDimensionId`
        # @return [String]
        attr_accessor :reporting_dimension_id
      
        # Required. State of the ad unit.
        # Corresponds to the JSON property `state`
        # @return [String]
        attr_accessor :state
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @content_ads_settings = args[:content_ads_settings] if args.key?(:content_ads_settings)
          @display_name = args[:display_name] if args.key?(:display_name)
          @name = args[:name] if args.key?(:name)
          @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
          @state = args[:state] if args.key?(:state)
        end
      end
      
      # Representation of the ad unit code for a given ad unit. For more information,
      # see [About the AdSense code](https://support.google.com/adsense/answer/9274634)
      # and [Where to place the ad code in your HTML](https://support.google.com/
      # adsense/answer/9190028).
      class AdUnitAdCode
        include Google::Apis::Core::Hashable
      
        # Output only. The code snippet to add to the body of an HTML page.
        # Corresponds to the JSON property `adCode`
        # @return [String]
        attr_accessor :ad_code
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @ad_code = args[:ad_code] if args.key?(:ad_code)
        end
      end
      
      # Representation of an alert.
      class Alert
        include Google::Apis::Core::Hashable
      
        # Output only. The localized alert message. This may contain HTML markup, such
        # as phrase elements or links.
        # Corresponds to the JSON property `message`
        # @return [String]
        attr_accessor :message
      
        # Output only. Resource name of the alert. Format: accounts/`account`/alerts/`
        # alert`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Severity of this alert.
        # Corresponds to the JSON property `severity`
        # @return [String]
        attr_accessor :severity
      
        # Output only. Type of alert. This identifies the broad type of this alert, and
        # provides a stable machine-readable identifier that will not be translated. For
        # example, "payment-hold".
        # Corresponds to the JSON property `type`
        # @return [String]
        attr_accessor :type
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @message = args[:message] if args.key?(:message)
          @name = args[:name] if args.key?(:name)
          @severity = args[:severity] if args.key?(:severity)
          @type = args[:type] if args.key?(:type)
        end
      end
      
      # Cell representation.
      class Cell
        include Google::Apis::Core::Hashable
      
        # Value in the cell. The dimension cells contain strings, and the metric cells
        # contain numbers.
        # Corresponds to the JSON property `value`
        # @return [String]
        attr_accessor :value
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @value = args[:value] if args.key?(:value)
        end
      end
      
      # Settings specific to content ads (AFC).
      class ContentAdsSettings
        include Google::Apis::Core::Hashable
      
        # Required. Size of the ad unit. e.g. "728x90", "1x3" (for responsive ad units).
        # Corresponds to the JSON property `size`
        # @return [String]
        attr_accessor :size
      
        # Required. Type of the ad unit.
        # Corresponds to the JSON property `type`
        # @return [String]
        attr_accessor :type
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @size = args[:size] if args.key?(:size)
          @type = args[:type] if args.key?(:type)
        end
      end
      
      # Representation of a custom channel.
      class CustomChannel
        include Google::Apis::Core::Hashable
      
        # Whether the custom channel is active and collecting data. See https://support.
        # google.com/adsense/answer/10077192.
        # Corresponds to the JSON property `active`
        # @return [Boolean]
        attr_accessor :active
        alias_method :active?, :active
      
        # Required. Display name of the custom channel.
        # Corresponds to the JSON property `displayName`
        # @return [String]
        attr_accessor :display_name
      
        # Output only. Resource name of the custom channel. Format: accounts/`account`/
        # adclients/`adclient`/customchannels/`customchannel`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Unique ID of the custom channel as used in the `CUSTOM_CHANNEL_ID`
        # reporting dimension.
        # Corresponds to the JSON property `reportingDimensionId`
        # @return [String]
        attr_accessor :reporting_dimension_id
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @active = args[:active] if args.key?(:active)
          @display_name = args[:display_name] if args.key?(:display_name)
          @name = args[:name] if args.key?(:name)
          @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
        end
      end
      
      # Represents a whole or partial calendar date, such as a birthday. The time of
      # day and time zone are either specified elsewhere or are insignificant. The
      # date is relative to the Gregorian Calendar. This can represent one of the
      # following: * A full date, with non-zero year, month, and day values. * A month
      # and day, with a zero year (for example, an anniversary). * A year on its own,
      # with a zero month and a zero day. * A year and month, with a zero day (for
      # example, a credit card expiration date). Related types: * google.type.
      # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
      class Date
        include Google::Apis::Core::Hashable
      
        # 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.
        # Corresponds to the JSON property `day`
        # @return [Fixnum]
        attr_accessor :day
      
        # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month
        # and day.
        # Corresponds to the JSON property `month`
        # @return [Fixnum]
        attr_accessor :month
      
        # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a
        # year.
        # Corresponds to the JSON property `year`
        # @return [Fixnum]
        attr_accessor :year
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @day = args[:day] if args.key?(:day)
          @month = args[:month] if args.key?(:month)
          @year = args[:year] if args.key?(:year)
        end
      end
      
      # A generic empty message that you can re-use to avoid defining duplicated empty
      # messages in your APIs. A typical example is to use it as the request or the
      # response type of an API method. For instance: service Foo ` rpc Bar(google.
      # protobuf.Empty) returns (google.protobuf.Empty); `
      class Empty
        include Google::Apis::Core::Hashable
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
        end
      end
      
      # The header information of the columns requested in the report.
      class Header
        include Google::Apis::Core::Hashable
      
        # The [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217) of this
        # column. Only present if the header type is METRIC_CURRENCY.
        # Corresponds to the JSON property `currencyCode`
        # @return [String]
        attr_accessor :currency_code
      
        # Required. Name of the header.
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Required. Type of the header.
        # Corresponds to the JSON property `type`
        # @return [String]
        attr_accessor :type
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @currency_code = args[:currency_code] if args.key?(:currency_code)
          @name = args[:name] if args.key?(:name)
          @type = args[:type] if args.key?(:type)
        end
      end
      
      # Message that represents an arbitrary HTTP body. It should only be used for
      # payload formats that can't be represented as JSON, such as raw binary or an
      # HTML page. This message can be used both in streaming and non-streaming API
      # methods in the request as well as the response. It can be used as a top-level
      # request field, which is convenient if one wants to extract parameters from
      # either the URL or HTTP template into the request fields and also want access
      # to the raw HTTP body. Example: message GetResourceRequest ` // A unique
      # request id. string request_id = 1; // The raw HTTP body is bound to this field.
      # google.api.HttpBody http_body = 2; ` service ResourceService ` rpc
      # GetResource(GetResourceRequest) returns (google.api.HttpBody); rpc
      # UpdateResource(google.api.HttpBody) returns (google.protobuf.Empty); ` Example
      # with streaming methods: service CaldavService ` rpc GetCalendar(stream google.
      # api.HttpBody) returns (stream google.api.HttpBody); rpc UpdateCalendar(stream
      # google.api.HttpBody) returns (stream google.api.HttpBody); ` Use of this type
      # only changes how the request and response bodies are handled, all other
      # features will continue to work unchanged.
      class HttpBody
        include Google::Apis::Core::Hashable
      
        # The HTTP Content-Type header value specifying the content type of the body.
        # Corresponds to the JSON property `contentType`
        # @return [String]
        attr_accessor :content_type
      
        # The HTTP request/response body as raw binary.
        # Corresponds to the JSON property `data`
        # NOTE: Values are automatically base64 encoded/decoded in the client library.
        # @return [String]
        attr_accessor :data
      
        # Application specific response metadata. Must be set in the first response for
        # streaming APIs.
        # Corresponds to the JSON property `extensions`
        # @return [Array<Hash<String,Object>>]
        attr_accessor :extensions
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @content_type = args[:content_type] if args.key?(:content_type)
          @data = args[:data] if args.key?(:data)
          @extensions = args[:extensions] if args.key?(:extensions)
        end
      end
      
      # Response definition for the account list rpc.
      class ListAccountsResponse
        include Google::Apis::Core::Hashable
      
        # The accounts returned in this list response.
        # Corresponds to the JSON property `accounts`
        # @return [Array<Google::Apis::AdsenseV2::Account>]
        attr_accessor :accounts
      
        # Continuation token used to page through accounts. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @accounts = args[:accounts] if args.key?(:accounts)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the ad client list rpc.
      class ListAdClientsResponse
        include Google::Apis::Core::Hashable
      
        # The ad clients returned in this list response.
        # Corresponds to the JSON property `adClients`
        # @return [Array<Google::Apis::AdsenseV2::AdClient>]
        attr_accessor :ad_clients
      
        # Continuation token used to page through ad clients. To retrieve the next page
        # of the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @ad_clients = args[:ad_clients] if args.key?(:ad_clients)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the adunit list rpc.
      class ListAdUnitsResponse
        include Google::Apis::Core::Hashable
      
        # The ad units returned in the list response.
        # Corresponds to the JSON property `adUnits`
        # @return [Array<Google::Apis::AdsenseV2::AdUnit>]
        attr_accessor :ad_units
      
        # Continuation token used to page through ad units. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @ad_units = args[:ad_units] if args.key?(:ad_units)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the alerts list rpc.
      class ListAlertsResponse
        include Google::Apis::Core::Hashable
      
        # The alerts returned in this list response.
        # Corresponds to the JSON property `alerts`
        # @return [Array<Google::Apis::AdsenseV2::Alert>]
        attr_accessor :alerts
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @alerts = args[:alerts] if args.key?(:alerts)
        end
      end
      
      # Response definition for the child account list rpc.
      class ListChildAccountsResponse
        include Google::Apis::Core::Hashable
      
        # The accounts returned in this list response.
        # Corresponds to the JSON property `accounts`
        # @return [Array<Google::Apis::AdsenseV2::Account>]
        attr_accessor :accounts
      
        # Continuation token used to page through accounts. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @accounts = args[:accounts] if args.key?(:accounts)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the custom channel list rpc.
      class ListCustomChannelsResponse
        include Google::Apis::Core::Hashable
      
        # The custom channels returned in this list response.
        # Corresponds to the JSON property `customChannels`
        # @return [Array<Google::Apis::AdsenseV2::CustomChannel>]
        attr_accessor :custom_channels
      
        # Continuation token used to page through alerts. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @custom_channels = args[:custom_channels] if args.key?(:custom_channels)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the ad units linked to a custom channel list rpc.
      class ListLinkedAdUnitsResponse
        include Google::Apis::Core::Hashable
      
        # The ad units returned in the list response.
        # Corresponds to the JSON property `adUnits`
        # @return [Array<Google::Apis::AdsenseV2::AdUnit>]
        attr_accessor :ad_units
      
        # Continuation token used to page through ad units. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @ad_units = args[:ad_units] if args.key?(:ad_units)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the custom channels linked to an adunit list rpc.
      class ListLinkedCustomChannelsResponse
        include Google::Apis::Core::Hashable
      
        # The custom channels returned in this list response.
        # Corresponds to the JSON property `customChannels`
        # @return [Array<Google::Apis::AdsenseV2::CustomChannel>]
        attr_accessor :custom_channels
      
        # Continuation token used to page through alerts. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @custom_channels = args[:custom_channels] if args.key?(:custom_channels)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
        end
      end
      
      # Response definition for the payments list rpc.
      class ListPaymentsResponse
        include Google::Apis::Core::Hashable
      
        # The payments returned in this list response.
        # Corresponds to the JSON property `payments`
        # @return [Array<Google::Apis::AdsenseV2::Payment>]
        attr_accessor :payments
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @payments = args[:payments] if args.key?(:payments)
        end
      end
      
      # Response definition for the policy issues list rpc. Policy issues are reported
      # only if the publisher has at least one AFC ad client in READY or GETTING_READY
      # state. If the publisher has no such AFC ad client, the response will be an
      # empty list.
      class ListPolicyIssuesResponse
        include Google::Apis::Core::Hashable
      
        # Continuation token used to page through policy issues. To retrieve the next
        # page of the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        # The policy issues returned in the list response.
        # Corresponds to the JSON property `policyIssues`
        # @return [Array<Google::Apis::AdsenseV2::PolicyIssue>]
        attr_accessor :policy_issues
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @policy_issues = args[:policy_issues] if args.key?(:policy_issues)
        end
      end
      
      # Response definition for the saved reports list rpc.
      class ListSavedReportsResponse
        include Google::Apis::Core::Hashable
      
        # Continuation token used to page through reports. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        # The reports returned in this list response.
        # Corresponds to the JSON property `savedReports`
        # @return [Array<Google::Apis::AdsenseV2::SavedReport>]
        attr_accessor :saved_reports
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @saved_reports = args[:saved_reports] if args.key?(:saved_reports)
        end
      end
      
      # Response definition for the sites list rpc.
      class ListSitesResponse
        include Google::Apis::Core::Hashable
      
        # Continuation token used to page through sites. To retrieve the next page of
        # the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        # The sites returned in this list response.
        # Corresponds to the JSON property `sites`
        # @return [Array<Google::Apis::AdsenseV2::Site>]
        attr_accessor :sites
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @sites = args[:sites] if args.key?(:sites)
        end
      end
      
      # Response definition for the url channels list rpc.
      class ListUrlChannelsResponse
        include Google::Apis::Core::Hashable
      
        # Continuation token used to page through url channels. To retrieve the next
        # page of the results, set the next request's "page_token" value to this.
        # Corresponds to the JSON property `nextPageToken`
        # @return [String]
        attr_accessor :next_page_token
      
        # The url channels returned in this list response.
        # Corresponds to the JSON property `urlChannels`
        # @return [Array<Google::Apis::AdsenseV2::UrlChannel>]
        attr_accessor :url_channels
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @next_page_token = args[:next_page_token] if args.key?(:next_page_token)
          @url_channels = args[:url_channels] if args.key?(:url_channels)
        end
      end
      
      # Representation of an unpaid or paid payment. See [Payment timelines for
      # AdSense](https://support.google.com/adsense/answer/7164703) for more
      # information about payments and the [YouTube homepage and payments account](
      # https://support.google.com/adsense/answer/11622510) article for information
      # about dedicated payments accounts for YouTube.
      class Payment
        include Google::Apis::Core::Hashable
      
        # Output only. The amount of unpaid or paid earnings, as a formatted string,
        # including the currency. E.g. "¥1,235 JPY", "$1,234.57", "£87.65".
        # Corresponds to the JSON property `amount`
        # @return [String]
        attr_accessor :amount
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `date`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :date
      
        # Output only. Resource name of the payment. Format: - accounts/`account`/
        # payments/unpaid for unpaid (current) AdSense earnings. - accounts/`account`/
        # payments/youtube-unpaid for unpaid (current) YouTube earnings. - accounts/`
        # account`/payments/yyyy-MM-dd for paid AdSense earnings. - accounts/`account`/
        # payments/youtube-yyyy-MM-dd for paid YouTube earnings.
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @amount = args[:amount] if args.key?(:amount)
          @date = args[:date] if args.key?(:date)
          @name = args[:name] if args.key?(:name)
        end
      end
      
      # Representation of a policy issue for a single entity (site, site-section, or
      # page). All issues for a single entity are represented by a single PolicyIssue
      # resource, though that PolicyIssue can have multiple causes (or "topics") that
      # can change over time. Policy issues are removed if there are no issues
      # detected recently or if there's a recent successful appeal for the entity.
      class PolicyIssue
        include Google::Apis::Core::Hashable
      
        # Required. The most severe action taken on the entity over the past seven days.
        # Corresponds to the JSON property `action`
        # @return [String]
        attr_accessor :action
      
        # Optional. List of ad clients associated with the policy issue (either as the
        # primary ad client or an associated host/secondary ad client). In the latter
        # case, this will be an ad client that is not owned by the current account.
        # Corresponds to the JSON property `adClients`
        # @return [Array<String>]
        attr_accessor :ad_clients
      
        # Required. Total number of ad requests affected by the policy violations over
        # the past seven days.
        # Corresponds to the JSON property `adRequestCount`
        # @return [Fixnum]
        attr_accessor :ad_request_count
      
        # Required. Type of the entity indicating if the entity is a site, site-section,
        # or page.
        # Corresponds to the JSON property `entityType`
        # @return [String]
        attr_accessor :entity_type
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `firstDetectedDate`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :first_detected_date
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `lastDetectedDate`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :last_detected_date
      
        # Required. Resource name of the entity with policy issues. Format: accounts/`
        # account`/policyIssues/`policy_issue`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Required. Unordered list. The policy topics that this entity was found to
        # violate over the past seven days.
        # Corresponds to the JSON property `policyTopics`
        # @return [Array<Google::Apis::AdsenseV2::PolicyTopic>]
        attr_accessor :policy_topics
      
        # Required. Hostname/domain of the entity (for example "foo.com" or "www.foo.com"
        # ). This _should_ be a bare domain/host name without any protocol. This will be
        # present for all policy issues.
        # Corresponds to the JSON property `site`
        # @return [String]
        attr_accessor :site
      
        # Optional. Prefix of the site-section having policy issues (For example "foo.
        # com/bar-section"). This will be present if the `entity_type` is `SITE_SECTION`
        # and will be absent for other entity types.
        # Corresponds to the JSON property `siteSection`
        # @return [String]
        attr_accessor :site_section
      
        # Optional. URI of the page having policy violations (for example "foo.com/bar"
        # or "www.foo.com/bar"). This will be present if the `entity_type` is `PAGE` and
        # will be absent for other entity types.
        # Corresponds to the JSON property `uri`
        # @return [String]
        attr_accessor :uri
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `warningEscalationDate`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :warning_escalation_date
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @action = args[:action] if args.key?(:action)
          @ad_clients = args[:ad_clients] if args.key?(:ad_clients)
          @ad_request_count = args[:ad_request_count] if args.key?(:ad_request_count)
          @entity_type = args[:entity_type] if args.key?(:entity_type)
          @first_detected_date = args[:first_detected_date] if args.key?(:first_detected_date)
          @last_detected_date = args[:last_detected_date] if args.key?(:last_detected_date)
          @name = args[:name] if args.key?(:name)
          @policy_topics = args[:policy_topics] if args.key?(:policy_topics)
          @site = args[:site] if args.key?(:site)
          @site_section = args[:site_section] if args.key?(:site_section)
          @uri = args[:uri] if args.key?(:uri)
          @warning_escalation_date = args[:warning_escalation_date] if args.key?(:warning_escalation_date)
        end
      end
      
      # Information about a particular policy topic. A policy topic represents a
      # single class of policy issue that can impact ad serving for your site. For
      # example, sexual content or having ads that obscure your content. A single
      # policy issue can have multiple policy topics for a single entity.
      class PolicyTopic
        include Google::Apis::Core::Hashable
      
        # Required. Deprecated. Always set to false.
        # Corresponds to the JSON property `mustFix`
        # @return [Boolean]
        attr_accessor :must_fix
        alias_method :must_fix?, :must_fix
      
        # Required. The policy topic. For example, "sexual-content" or "ads-obscuring-
        # content"."
        # Corresponds to the JSON property `topic`
        # @return [String]
        attr_accessor :topic
      
        # Optional. The type of policy topic. For example, "POLICY" represents all the
        # policy topics that are related to the Google Publisher Policy (GPP). See https:
        # //support.google.com/adsense/answer/15689616.
        # Corresponds to the JSON property `type`
        # @return [String]
        attr_accessor :type
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @must_fix = args[:must_fix] if args.key?(:must_fix)
          @topic = args[:topic] if args.key?(:topic)
          @type = args[:type] if args.key?(:type)
        end
      end
      
      # Result of a generated report.
      class ReportResult
        include Google::Apis::Core::Hashable
      
        # Row representation.
        # Corresponds to the JSON property `averages`
        # @return [Google::Apis::AdsenseV2::Row]
        attr_accessor :averages
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `endDate`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :end_date
      
        # The header information; one for each dimension in the request, followed by one
        # for each metric in the request.
        # Corresponds to the JSON property `headers`
        # @return [Array<Google::Apis::AdsenseV2::Header>]
        attr_accessor :headers
      
        # The output rows of the report. Each row is a list of cells; one for each
        # dimension in the request, followed by one for each metric in the request.
        # Corresponds to the JSON property `rows`
        # @return [Array<Google::Apis::AdsenseV2::Row>]
        attr_accessor :rows
      
        # Represents a whole or partial calendar date, such as a birthday. The time of
        # day and time zone are either specified elsewhere or are insignificant. The
        # date is relative to the Gregorian Calendar. This can represent one of the
        # following: * A full date, with non-zero year, month, and day values. * A month
        # and day, with a zero year (for example, an anniversary). * A year on its own,
        # with a zero month and a zero day. * A year and month, with a zero day (for
        # example, a credit card expiration date). Related types: * google.type.
        # TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
        # Corresponds to the JSON property `startDate`
        # @return [Google::Apis::AdsenseV2::Date]
        attr_accessor :start_date
      
        # The total number of rows matched by the report request.
        # Corresponds to the JSON property `totalMatchedRows`
        # @return [Fixnum]
        attr_accessor :total_matched_rows
      
        # Row representation.
        # Corresponds to the JSON property `totals`
        # @return [Google::Apis::AdsenseV2::Row]
        attr_accessor :totals
      
        # Any warnings associated with generation of the report. These warnings are
        # always returned in English.
        # Corresponds to the JSON property `warnings`
        # @return [Array<String>]
        attr_accessor :warnings
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @averages = args[:averages] if args.key?(:averages)
          @end_date = args[:end_date] if args.key?(:end_date)
          @headers = args[:headers] if args.key?(:headers)
          @rows = args[:rows] if args.key?(:rows)
          @start_date = args[:start_date] if args.key?(:start_date)
          @total_matched_rows = args[:total_matched_rows] if args.key?(:total_matched_rows)
          @totals = args[:totals] if args.key?(:totals)
          @warnings = args[:warnings] if args.key?(:warnings)
        end
      end
      
      # Row representation.
      class Row
        include Google::Apis::Core::Hashable
      
        # Cells in the row.
        # Corresponds to the JSON property `cells`
        # @return [Array<Google::Apis::AdsenseV2::Cell>]
        attr_accessor :cells
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @cells = args[:cells] if args.key?(:cells)
        end
      end
      
      # Representation of a saved report.
      class SavedReport
        include Google::Apis::Core::Hashable
      
        # Output only. Resource name of the report. Format: accounts/`account`/reports/`
        # report`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Report title as specified by publisher.
        # Corresponds to the JSON property `title`
        # @return [String]
        attr_accessor :title
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @name = args[:name] if args.key?(:name)
          @title = args[:title] if args.key?(:title)
        end
      end
      
      # Representation of a Site.
      class Site
        include Google::Apis::Core::Hashable
      
        # Whether auto ads is turned on for the site.
        # Corresponds to the JSON property `autoAdsEnabled`
        # @return [Boolean]
        attr_accessor :auto_ads_enabled
        alias_method :auto_ads_enabled?, :auto_ads_enabled
      
        # Domain (or subdomain) of the site, e.g. "example.com" or "www.example.com".
        # This is used in the `OWNED_SITE_DOMAIN_NAME` reporting dimension.
        # Corresponds to the JSON property `domain`
        # @return [String]
        attr_accessor :domain
      
        # Output only. Resource name of a site. Format: accounts/`account`/sites/`site`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Unique ID of the site as used in the `OWNED_SITE_ID` reporting
        # dimension.
        # Corresponds to the JSON property `reportingDimensionId`
        # @return [String]
        attr_accessor :reporting_dimension_id
      
        # Output only. State of a site.
        # Corresponds to the JSON property `state`
        # @return [String]
        attr_accessor :state
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @auto_ads_enabled = args[:auto_ads_enabled] if args.key?(:auto_ads_enabled)
          @domain = args[:domain] if args.key?(:domain)
          @name = args[:name] if args.key?(:name)
          @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
          @state = args[:state] if args.key?(:state)
        end
      end
      
      # Represents a time zone from the [IANA Time Zone Database](https://www.iana.org/
      # time-zones).
      class TimeZone
        include Google::Apis::Core::Hashable
      
        # IANA Time Zone Database time zone. For example "America/New_York".
        # Corresponds to the JSON property `id`
        # @return [String]
        attr_accessor :id
      
        # Optional. IANA Time Zone Database version number. For example "2019a".
        # Corresponds to the JSON property `version`
        # @return [String]
        attr_accessor :version
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @id = args[:id] if args.key?(:id)
          @version = args[:version] if args.key?(:version)
        end
      end
      
      # Representation of a URL channel. URL channels allow you to track the
      # performance of particular pages in your site; see [URL channels](https://
      # support.google.com/adsense/answer/2923836) for more information.
      class UrlChannel
        include Google::Apis::Core::Hashable
      
        # Output only. Resource name of the URL channel. Format: accounts/`account`/
        # adclients/`adclient`/urlchannels/`urlchannel`
        # Corresponds to the JSON property `name`
        # @return [String]
        attr_accessor :name
      
        # Output only. Unique ID of the custom channel as used in the `URL_CHANNEL_ID`
        # reporting dimension.
        # Corresponds to the JSON property `reportingDimensionId`
        # @return [String]
        attr_accessor :reporting_dimension_id
      
        # URI pattern of the channel. Does not include "http://" or "https://". Example:
        # www.example.com/home
        # Corresponds to the JSON property `uriPattern`
        # @return [String]
        attr_accessor :uri_pattern
      
        def initialize(**args)
           update!(**args)
        end
      
        # Update properties of this object
        def update!(**args)
          @name = args[:name] if args.key?(:name)
          @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
          @uri_pattern = args[:uri_pattern] if args.key?(:uri_pattern)
        end
      end
    end
  end
end
