{
  "protocol": "rest",
  "id": "adsenseplatform:v1",
  "kind": "discovery#restDescription",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/adsense.readonly": {
          "description": "View your AdSense data"
        },
        "https://www.googleapis.com/auth/adsense": {
          "description": "View and manage your AdSense data"
        }
      }
    }
  },
  "batchPath": "batch",
  "version": "v1",
  "parameters": {
    "uploadType": {
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query",
      "type": "string"
    },
    "upload_protocol": {
      "type": "string",
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    },
    "$.xgafv": {
      "type": "string",
      "description": "V1 error format.",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "enum": [
        "1",
        "2"
      ]
    },
    "quotaUser": {
      "type": "string",
      "description": "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.",
      "location": "query"
    },
    "prettyPrint": {
      "default": "true",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    },
    "fields": {
      "location": "query",
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string"
    },
    "key": {
      "type": "string",
      "location": "query",
      "description": "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."
    },
    "access_token": {
      "location": "query",
      "description": "OAuth access token.",
      "type": "string"
    },
    "alt": {
      "location": "query",
      "description": "Data format for response.",
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "default": "json"
    },
    "callback": {
      "location": "query",
      "description": "JSONP",
      "type": "string"
    }
  },
  "resources": {
    "platforms": {
      "resources": {
        "accounts": {
          "methods": {
            "list": {
              "response": {
                "$ref": "ListAccountsResponse"
              },
              "path": "v1/{+parent}/accounts",
              "id": "adsenseplatform.platforms.accounts.list",
              "description": "Lists a partial view of sub-accounts for a specific parent account.",
              "parameters": {
                "parent": {
                  "location": "path",
                  "required": true,
                  "type": "string",
                  "description": "Required. Platform who parents the accounts. Format: platforms/{platform}",
                  "pattern": "^platforms/[^/]+$"
                },
                "pageToken": {
                  "type": "string",
                  "description": "Optional. A page token, received from a previous `ListAccounts` call. Provide this to retrieve the subsequent page.",
                  "location": "query"
                },
                "pageSize": {
                  "description": "Optional. The maximum number of accounts to include in the response, used for paging. If unspecified, at most 10000 accounts will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000.",
                  "location": "query",
                  "type": "integer",
                  "format": "int32"
                }
              },
              "flatPath": "v1/platforms/{platformsId}/accounts",
              "httpMethod": "GET",
              "scopes": [
                "https://www.googleapis.com/auth/adsense",
                "https://www.googleapis.com/auth/adsense.readonly"
              ],
              "parameterOrder": [
                "parent"
              ]
            },
            "create": {
              "parameterOrder": [
                "parent"
              ],
              "path": "v1/{+parent}/accounts",
              "scopes": [
                "https://www.googleapis.com/auth/adsense"
              ],
              "response": {
                "$ref": "Account"
              },
              "parameters": {
                "parent": {
                  "pattern": "^platforms/[^/]+$",
                  "type": "string",
                  "location": "path",
                  "required": true,
                  "description": "Required. Platform to create an account for. Format: platforms/{platform}"
                }
              },
              "httpMethod": "POST",
              "description": "Creates a sub-account.",
              "id": "adsenseplatform.platforms.accounts.create",
              "flatPath": "v1/platforms/{platformsId}/accounts",
              "request": {
                "$ref": "Account"
              }
            },
            "lookup": {
              "parameters": {
                "parent": {
                  "type": "string",
                  "pattern": "^platforms/[^/]+$",
                  "description": "Required. Platform who parents the account. Format: platforms/{platform}",
                  "location": "path",
                  "required": true
                },
                "creationRequestId": {
                  "description": "Optional. The creation_request_id provided when calling createAccount.",
                  "type": "string",
                  "location": "query"
                }
              },
              "scopes": [
                "https://www.googleapis.com/auth/adsense",
                "https://www.googleapis.com/auth/adsense.readonly"
              ],
              "flatPath": "v1/platforms/{platformsId}/accounts:lookup",
              "httpMethod": "GET",
              "id": "adsenseplatform.platforms.accounts.lookup",
              "path": "v1/{+parent}/accounts:lookup",
              "response": {
                "$ref": "LookupAccountResponse"
              },
              "parameterOrder": [
                "parent"
              ],
              "description": "Looks up information about a sub-account for a specified creation_request_id. If no account exists for the given creation_request_id, returns 404."
            },
            "get": {
              "response": {
                "$ref": "Account"
              },
              "id": "adsenseplatform.platforms.accounts.get",
              "description": "Gets information about the selected sub-account.",
              "scopes": [
                "https://www.googleapis.com/auth/adsense",
                "https://www.googleapis.com/auth/adsense.readonly"
              ],
              "parameterOrder": [
                "name"
              ],
              "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}",
              "path": "v1/{+name}",
              "httpMethod": "GET",
              "parameters": {
                "name": {
                  "description": "Required. Account to get information about. Format: platforms/{platform}/accounts/{account_id}",
                  "pattern": "^platforms/[^/]+/accounts/[^/]+$",
                  "type": "string",
                  "location": "path",
                  "required": true
                }
              }
            },
            "close": {
              "httpMethod": "POST",
              "parameters": {
                "name": {
                  "description": "Required. Account to close. Format: platforms/{platform}/accounts/{account_id}",
                  "type": "string",
                  "location": "path",
                  "required": true,
                  "pattern": "^platforms/[^/]+/accounts/[^/]+$"
                }
              },
              "response": {
                "$ref": "CloseAccountResponse"
              },
              "request": {
                "$ref": "CloseAccountRequest"
              },
              "parameterOrder": [
                "name"
              ],
              "path": "v1/{+name}:close",
              "id": "adsenseplatform.platforms.accounts.close",
              "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}:close",
              "description": "Closes a sub-account.",
              "scopes": [
                "https://www.googleapis.com/auth/adsense"
              ]
            }
          },
          "resources": {
            "sites": {
              "methods": {
                "list": {
                  "parameterOrder": [
                    "parent"
                  ],
                  "parameters": {
                    "parent": {
                      "pattern": "^platforms/[^/]+/accounts/[^/]+$",
                      "description": "Required. The account which owns the sites. Format: platforms/{platform}/accounts/{account}",
                      "location": "path",
                      "required": true,
                      "type": "string"
                    },
                    "pageToken": {
                      "description": "A page token, received from a previous `ListSites` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListSites` must match the call that provided the page token.",
                      "location": "query",
                      "type": "string"
                    },
                    "pageSize": {
                      "description": "The maximum number of sites to include in the response, used for paging. If unspecified, at most 10000 sites will be returned. The maximum value is 10000; values above 10000 will be coerced to 10000.",
                      "type": "integer",
                      "location": "query",
                      "format": "int32"
                    }
                  },
                  "response": {
                    "$ref": "ListSitesResponse"
                  },
                  "httpMethod": "GET",
                  "path": "v1/{+parent}/sites",
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense",
                    "https://www.googleapis.com/auth/adsense.readonly"
                  ],
                  "id": "adsenseplatform.platforms.accounts.sites.list",
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/sites",
                  "description": "Lists sites for a specific account."
                },
                "get": {
                  "httpMethod": "GET",
                  "response": {
                    "$ref": "Site"
                  },
                  "parameters": {
                    "name": {
                      "description": "Required. The name of the site to retrieve. Format: platforms/{platform}/accounts/{account}/sites/{site}",
                      "pattern": "^platforms/[^/]+/accounts/[^/]+/sites/[^/]+$",
                      "type": "string",
                      "location": "path",
                      "required": true
                    }
                  },
                  "id": "adsenseplatform.platforms.accounts.sites.get",
                  "parameterOrder": [
                    "name"
                  ],
                  "path": "v1/{+name}",
                  "description": "Gets a site from a specified sub-account.",
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense",
                    "https://www.googleapis.com/auth/adsense.readonly"
                  ],
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/sites/{sitesId}"
                },
                "delete": {
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/sites/{sitesId}",
                  "id": "adsenseplatform.platforms.accounts.sites.delete",
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense"
                  ],
                  "response": {
                    "$ref": "Empty"
                  },
                  "path": "v1/{+name}",
                  "httpMethod": "DELETE",
                  "parameters": {
                    "name": {
                      "description": "Required. The name of the site to delete. Format: platforms/{platform}/accounts/{account}/sites/{site}",
                      "location": "path",
                      "required": true,
                      "pattern": "^platforms/[^/]+/accounts/[^/]+/sites/[^/]+$",
                      "type": "string"
                    }
                  },
                  "description": "Deletes a site from a specified account.",
                  "parameterOrder": [
                    "name"
                  ]
                },
                "create": {
                  "parameterOrder": [
                    "parent"
                  ],
                  "response": {
                    "$ref": "Site"
                  },
                  "request": {
                    "$ref": "Site"
                  },
                  "id": "adsenseplatform.platforms.accounts.sites.create",
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense"
                  ],
                  "description": "Creates a site for a specified account.",
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/sites",
                  "path": "v1/{+parent}/sites",
                  "httpMethod": "POST",
                  "parameters": {
                    "parent": {
                      "type": "string",
                      "description": "Required. Account to create site. Format: platforms/{platform}/accounts/{account_id}",
                      "pattern": "^platforms/[^/]+/accounts/[^/]+$",
                      "location": "path",
                      "required": true
                    }
                  }
                },
                "requestReview": {
                  "id": "adsenseplatform.platforms.accounts.sites.requestReview",
                  "response": {
                    "$ref": "RequestSiteReviewResponse"
                  },
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense"
                  ],
                  "path": "v1/{+name}:requestReview",
                  "parameters": {
                    "name": {
                      "location": "path",
                      "required": true,
                      "type": "string",
                      "pattern": "^platforms/[^/]+/accounts/[^/]+/sites/[^/]+$",
                      "description": "Required. The name of the site to submit for review. Format: platforms/{platform}/accounts/{account}/sites/{site}"
                    }
                  },
                  "httpMethod": "POST",
                  "parameterOrder": [
                    "name"
                  ],
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/sites/{sitesId}:requestReview",
                  "description": "Requests the review of a site. The site should be in REQUIRES_REVIEW or NEEDS_ATTENTION state. Note: Make sure you place an [ad tag](https://developers.google.com/adsense/platforms/direct/ad-tags) on your site before requesting a review."
                }
              }
            },
            "events": {
              "methods": {
                "create": {
                  "response": {
                    "$ref": "Event"
                  },
                  "parameters": {
                    "parent": {
                      "description": "Required. Account to log events about. Format: platforms/{platform}/accounts/{account}",
                      "type": "string",
                      "pattern": "^platforms/[^/]+/accounts/[^/]+$",
                      "location": "path",
                      "required": true
                    }
                  },
                  "id": "adsenseplatform.platforms.accounts.events.create",
                  "httpMethod": "POST",
                  "request": {
                    "$ref": "Event"
                  },
                  "description": "Creates an account event.",
                  "parameterOrder": [
                    "parent"
                  ],
                  "flatPath": "v1/platforms/{platformsId}/accounts/{accountsId}/events",
                  "scopes": [
                    "https://www.googleapis.com/auth/adsense"
                  ],
                  "path": "v1/{+parent}/events"
                }
              }
            }
          }
        }
      }
    }
  },
  "baseUrl": "https://adsenseplatform.googleapis.com/",
  "documentationLink": "https://developers.google.com/adsense/platforms/",
  "name": "adsenseplatform",
  "ownerName": "Google",
  "fullyEncodeReservedExpansion": true,
  "title": "AdSense Platform API",
  "icons": {
    "x32": "http://www.google.com/images/icons/product/search-32.gif",
    "x16": "http://www.google.com/images/icons/product/search-16.gif"
  },
  "canonicalName": "AdSense Platform",
  "description": "",
  "version_module": true,
  "revision": "20261116",
  "schemas": {
    "RequestSiteReviewResponse": {
      "properties": {},
      "type": "object",
      "id": "RequestSiteReviewResponse",
      "description": "Response definition for the site request review rpc."
    },
    "Site": {
      "description": "Representation of a Site.",
      "type": "object",
      "properties": {
        "name": {
          "readOnly": true,
          "description": "Output only. Resource name of a site. Format: platforms/{platform}/accounts/{account}/sites/{site}",
          "type": "string"
        },
        "domain": {
          "description": "Domain/sub-domain of the site. Must be a valid domain complying with [RFC 1035](https://www.ietf.org/rfc/rfc1035.txt) and formatted as punycode [RFC 3492](https://www.ietf.org/rfc/rfc3492.txt) in case the domain contains unicode characters.",
          "type": "string"
        },
        "state": {
          "description": "Output only. State of a site.",
          "enum": [
            "STATE_UNSPECIFIED",
            "REQUIRES_REVIEW",
            "GETTING_READY",
            "READY",
            "NEEDS_ATTENTION"
          ],
          "type": "string",
          "readOnly": true,
          "enumDescriptions": [
            "State unspecified.",
            "Either: - The site hasn't been checked yet. - The site is inactive and needs another review before it can show ads again. Learn how to [request a review for an inactive site](https://support.google.com/adsense/answer/9393996).",
            "Google is running some checks on the site. This usually takes a few days, but in some cases it can take two to four weeks.",
            "The site is ready to show ads. Learn how to [set up ads on the site](https://support.google.com/adsense/answer/7037624).",
            "Publisher needs to fix some issues before the site is ready to show ads. Learn what to do [if a new site isn't ready](https://support.google.com/adsense/answer/9061852)."
          ]
        }
      },
      "id": "Site"
    },
    "CloseAccountResponse": {
      "type": "object",
      "id": "CloseAccountResponse",
      "properties": {},
      "description": "Response definition for the account close rpc."
    },
    "ListAccountsResponse": {
      "id": "ListAccountsResponse",
      "properties": {
        "nextPageToken": {
          "type": "string",
          "description": "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."
        },
        "accounts": {
          "type": "array",
          "description": "The Accounts returned in the list response. Represented by a partial view of the Account resource, populating `name` and `creation_request_id`.",
          "items": {
            "$ref": "Account"
          }
        }
      },
      "description": "Response definition for the list accounts rpc.",
      "type": "object"
    },
    "ListSitesResponse": {
      "id": "ListSitesResponse",
      "description": "Response definition for the site list rpc.",
      "properties": {
        "nextPageToken": {
          "type": "string",
          "description": "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."
        },
        "sites": {
          "items": {
            "$ref": "Site"
          },
          "type": "array",
          "description": "The sites returned in this list response."
        }
      },
      "type": "object"
    },
    "Account": {
      "type": "object",
      "id": "Account",
      "description": "Representation of an Account.",
      "properties": {
        "name": {
          "readOnly": true,
          "description": "Output only. Resource name of the account. Format: platforms/pub-[0-9]+/accounts/pub-[0-9]+",
          "type": "string"
        },
        "creationRequestId": {
          "description": "Required. An opaque token that uniquely identifies the account among all the platform's accounts. This string may contain at most 64 non-whitespace ASCII characters, but otherwise has no predefined structure. However, it is expected to be a platform-specific identifier for the user creating the account, so that only a single account can be created for any given user. This field must not contain any information that is recognizable as personally identifiable information. e.g. it should not be an email address or login name. Once an account has been created, a second attempt to create an account using the same creation_request_id will result in an ALREADY_EXISTS error.",
          "type": "string"
        },
        "regionCode": {
          "type": "string",
          "description": "Required. Input only. CLDR region code of the country/region of the address. Set this to country code of the child account if known, otherwise to your own country code."
        },
        "displayName": {
          "type": "string",
          "description": "Display name of this account."
        },
        "createTime": {
          "type": "string",
          "readOnly": true,
          "format": "google-datetime",
          "description": "Output only. Creation time of the account."
        },
        "timeZone": {
          "$ref": "TimeZone",
          "description": "Required. The IANA TZ timezone code of this account. For more information, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones. This field is used for reporting. It is recommended to set it to the same value for all child accounts."
        },
        "state": {
          "enum": [
            "STATE_UNSPECIFIED",
            "UNCHECKED",
            "APPROVED",
            "DISAPPROVED"
          ],
          "readOnly": true,
          "enumDescriptions": [
            "Unspecified.",
            "Unchecked.",
            "The account is ready to serve ads.",
            "The account has been blocked from serving ads."
          ],
          "type": "string",
          "description": "Output only. Approval state of the account."
        }
      }
    },
    "Event": {
      "description": "A platform sub-account event to record spam signals.",
      "type": "object",
      "id": "Event",
      "properties": {
        "eventType": {
          "enum": [
            "EVENT_TYPE_UNSPECIFIED",
            "LOG_IN_VIA_PLATFORM",
            "SIGN_UP_VIA_PLATFORM"
          ],
          "enumDescriptions": [
            "Do not use. You must set an event type explicitly.",
            "Log in via platform.",
            "Sign up via platform."
          ],
          "type": "string",
          "description": "Required. Event type."
        },
        "eventInfo": {
          "description": "Required. Information associated with the event.",
          "$ref": "EventInfo"
        },
        "eventTime": {
          "description": "Required. Event timestamp.",
          "type": "string",
          "format": "google-datetime"
        }
      }
    },
    "Empty": {
      "type": "object",
      "properties": {},
      "description": "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); }",
      "id": "Empty"
    },
    "TimeZone": {
      "id": "TimeZone",
      "description": "Represents a time zone from the [IANA Time Zone Database](https://www.iana.org/time-zones).",
      "properties": {
        "id": {
          "description": "IANA Time Zone Database time zone. For example \"America/New_York\".",
          "type": "string"
        },
        "version": {
          "type": "string",
          "description": "Optional. IANA Time Zone Database version number. For example \"2019a\"."
        }
      },
      "type": "object"
    },
    "CloseAccountRequest": {
      "type": "object",
      "properties": {},
      "description": "Request definition for the account close rpc.",
      "id": "CloseAccountRequest"
    },
    "EventInfo": {
      "type": "object",
      "id": "EventInfo",
      "description": "Private information for partner recorded events (PII).",
      "properties": {
        "email": {
          "description": "Required. The email address that is associated with the publisher when performing the event.",
          "type": "string"
        },
        "billingAddress": {
          "description": "The billing address of the publisher associated with this event, if available.",
          "$ref": "Address"
        }
      }
    },
    "Address": {
      "description": "Address data.",
      "id": "Address",
      "type": "object",
      "properties": {
        "contact": {
          "description": "Contact name of the company. Max length 128 bytes or 34 characters.",
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "State. Max length 60 bytes or 30 characters."
        },
        "regionCode": {
          "description": "Country/Region code. The region is specified as a CLDR region code (e.g. \"US\", \"FR\").",
          "type": "string"
        },
        "address1": {
          "description": "First line of address. Max length 64 bytes or 30 characters.",
          "type": "string"
        },
        "address2": {
          "type": "string",
          "description": "Second line of address. Max length 64 bytes or 30 characters."
        },
        "zip": {
          "description": "Zip/post code. Max length 10 bytes or 10 characters.",
          "type": "string"
        },
        "phone": {
          "type": "string",
          "description": "Phone number with international code (i.e. +441234567890)."
        },
        "city": {
          "description": "City. Max length 60 bytes or 30 characters.",
          "type": "string"
        },
        "company": {
          "type": "string",
          "description": "Name of the company. Max length 255 bytes or 34 characters."
        },
        "fax": {
          "type": "string",
          "description": "Fax number with international code (i.e. +441234567890)."
        }
      }
    },
    "LookupAccountResponse": {
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the Account Format: platforms/{platform}/accounts/{account_id}"
        }
      },
      "id": "LookupAccountResponse",
      "type": "object",
      "description": "Response definition for the lookup account rpc."
    }
  },
  "servicePath": "",
  "ownerDomain": "google.com",
  "rootUrl": "https://adsenseplatform.googleapis.com/",
  "discoveryVersion": "v1",
  "mtlsRootUrl": "https://adsenseplatform.mtls.googleapis.com/",
  "basePath": ""
}
