{
  "canonicalName": "Subscription Linking",
  "mtlsRootUrl": "https://readerrevenuesubscriptionlinking.mtls.googleapis.com/",
  "name": "readerrevenuesubscriptionlinking",
  "title": "Reader Revenue Subscription Linking API",
  "ownerDomain": "google.com",
  "baseUrl": "https://readerrevenuesubscriptionlinking.googleapis.com/",
  "protocol": "rest",
  "version": "v1",
  "servicePath": "",
  "description": "readerrevenuesubscriptionlinking.googleapis.com API.",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "revision": "20260517",
  "resources": {
    "publications": {
      "resources": {
        "readers": {
          "methods": {
            "get": {
              "id": "readerrevenuesubscriptionlinking.publications.readers.get",
              "path": "v1/{+name}",
              "flatPath": "v1/publications/{publicationsId}/readers/{readersId}",
              "httpMethod": "GET",
              "parameters": {
                "name": {
                  "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}",
                  "pattern": "^publications/[^/]+/readers/[^/]+$",
                  "location": "path",
                  "required": true,
                  "type": "string"
                }
              },
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "Reader"
              },
              "description": "Gets a reader of a publication. Returns NOT_FOUND if the reader does not exist."
            },
            "delete": {
              "id": "readerrevenuesubscriptionlinking.publications.readers.delete",
              "path": "v1/{+name}",
              "flatPath": "v1/publications/{publicationsId}/readers/{readersId}",
              "httpMethod": "DELETE",
              "parameters": {
                "name": {
                  "description": "Required. The resource name of the reader. Format: publications/{publication_id}/readers/{ppid}",
                  "pattern": "^publications/[^/]+/readers/[^/]+$",
                  "location": "path",
                  "required": true,
                  "type": "string"
                },
                "force": {
                  "description": "If set to true, any entitlements under the reader will also be purged.",
                  "location": "query",
                  "type": "boolean"
                }
              },
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "DeleteReaderResponse"
              },
              "description": "Removes a publication reader, effectively severing the association with a Google user. If `force` is set to true, any entitlements for this reader will also be deleted. (Otherwise, the request will only work if the reader has no entitlements.) - If the reader does not exist, return NOT_FOUND. - Return FAILED_PRECONDITION if the force field is false (or unset) and entitlements are present."
            },
            "getEntitlements": {
              "id": "readerrevenuesubscriptionlinking.publications.readers.getEntitlements",
              "path": "v1/{+name}",
              "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements",
              "httpMethod": "GET",
              "parameters": {
                "name": {
                  "description": "Required. The name of the reader entitlements to retrieve. Format: publications/{publication_id}/readers/{reader_id}/entitlements",
                  "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$",
                  "location": "path",
                  "required": true,
                  "type": "string"
                }
              },
              "parameterOrder": [
                "name"
              ],
              "response": {
                "$ref": "ReaderEntitlements"
              },
              "description": "Gets the reader entitlements for a publication reader. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist."
            },
            "updateEntitlements": {
              "id": "readerrevenuesubscriptionlinking.publications.readers.updateEntitlements",
              "path": "v1/{+name}",
              "flatPath": "v1/publications/{publicationsId}/readers/{readersId}/entitlements",
              "httpMethod": "PATCH",
              "parameters": {
                "name": {
                  "description": "Output only. The resource name of the singleton.",
                  "pattern": "^publications/[^/]+/readers/[^/]+/entitlements$",
                  "location": "path",
                  "required": true,
                  "type": "string"
                },
                "updateMask": {
                  "description": "Optional. The list of fields to update. Defaults to all fields.",
                  "location": "query",
                  "type": "string",
                  "format": "google-fieldmask"
                }
              },
              "parameterOrder": [
                "name"
              ],
              "request": {
                "$ref": "ReaderEntitlements"
              },
              "response": {
                "$ref": "ReaderEntitlements"
              },
              "description": "Updates the reader entitlements for a publication reader. The entire reader entitlements will be overwritten by the new reader entitlements in the payload, like a PUT. - Returns PERMISSION_DENIED if the caller does not have access. - Returns NOT_FOUND if the reader does not exist."
            }
          }
        }
      }
    }
  },
  "schemas": {
    "Reader": {
      "id": "Reader",
      "description": "A reader of a publication.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Output only. The resource name of the reader. The last part of ppid in the resource name is the publisher provided id.",
          "readOnly": true,
          "type": "string"
        },
        "createTime": {
          "description": "Output only. Time the publication reader was created and associated with a Google user.",
          "readOnly": true,
          "type": "string",
          "format": "google-datetime"
        },
        "publicationId": {
          "description": "Output only. The SwG publication id that the reader has linked their subscription to.",
          "readOnly": true,
          "type": "string"
        },
        "ppid": {
          "description": "Output only. The publisher provided id of the reader.",
          "readOnly": true,
          "type": "string"
        },
        "originatingPublicationId": {
          "description": "Output only. The SwG publication id that the reader's subscription linking was originating from.",
          "readOnly": true,
          "type": "string"
        }
      }
    },
    "DeleteReaderResponse": {
      "id": "DeleteReaderResponse",
      "description": "Response to deleting a reader of a publication.",
      "type": "object",
      "properties": {}
    },
    "ReaderEntitlements": {
      "id": "ReaderEntitlements",
      "description": "A singleton containing all of a reader's entitlements for a publication.",
      "type": "object",
      "properties": {
        "name": {
          "description": "Output only. The resource name of the singleton.",
          "readOnly": true,
          "type": "string"
        },
        "entitlements": {
          "description": "All of the entitlements for a publication reader.",
          "type": "array",
          "items": {
            "$ref": "Entitlement"
          }
        }
      }
    },
    "Entitlement": {
      "id": "Entitlement",
      "description": "A single entitlement for a publication reader",
      "type": "object",
      "properties": {
        "productId": {
          "description": "Required. The publication's product ID that the user has access to. This is the same product ID as can be found in Schema.org markup (http://schema.org/productID). E.g. \"dailybugle.com:basic\"",
          "type": "string"
        },
        "subscriptionToken": {
          "description": "A source-specific subscription token. This is an opaque string that the publisher provides to Google. This token is opaque and has no meaning to Google.",
          "type": "string"
        },
        "detail": {
          "description": "The detail field can carry a description of the SKU that corresponds to what the user has been granted access to. This description, which is opaque to Google, can be displayed in the Google user subscription console for users who linked the subscription to a Google Account. Max 80 character limit.",
          "type": "string"
        },
        "expireTime": {
          "description": "Required. Expiration time of the entitlement. Entitlements that have expired over 30 days will be purged. The max expire_time is 398 days from now().",
          "type": "string",
          "format": "google-datetime"
        }
      }
    }
  },
  "documentationLink": "https://developers.google.com/news/subscribe/subscription-linking/overview",
  "fullyEncodeReservedExpansion": true,
  "parameters": {
    "access_token": {
      "type": "string",
      "description": "OAuth access token.",
      "location": "query"
    },
    "alt": {
      "type": "string",
      "description": "Data format for response.",
      "default": "json",
      "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"
      ],
      "location": "query"
    },
    "callback": {
      "type": "string",
      "description": "JSONP",
      "location": "query"
    },
    "fields": {
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query"
    },
    "key": {
      "type": "string",
      "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.",
      "location": "query"
    },
    "oauth_token": {
      "type": "string",
      "description": "OAuth 2.0 token for the current user.",
      "location": "query"
    },
    "prettyPrint": {
      "type": "boolean",
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "location": "query"
    },
    "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"
    },
    "upload_protocol": {
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "location": "query"
    },
    "uploadType": {
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query"
    },
    "$.xgafv": {
      "type": "string",
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ],
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query"
    }
  },
  "kind": "discovery#restDescription",
  "id": "readerrevenuesubscriptionlinking:v1",
  "discoveryVersion": "v1",
  "basePath": "",
  "batchPath": "batch",
  "version_module": true,
  "rootUrl": "https://readerrevenuesubscriptionlinking.googleapis.com/",
  "ownerName": "Google"
}
