# YouTube Data API . subscriptions

## Instance Methods

Deletes a subscription.

Adds a subscription for the authenticated user's channel.

Returns subscription resources that match the API request criteria.

Retrieves the next page of results.

### Method Details

`delete(id)`

    Deletes a subscription.

    Args:
      id: string, The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID. (required)

`insert(part=None, body)`

    Adds a subscription for the authenticated user's channel.

    Args:
      part: string, The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.

    The part names that you can include in the parameter value are snippet and contentDetails. (required)
      body: object, The request body. (required)
        The object takes the form of:

    { # A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
        "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
        "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
          "newItemCount": 42, # The number of new items in the subscription since its content was last read.
          "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
          "totalItemCount": 42, # The approximate number of items that the subscription points to.
        },
        "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
          "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.
            "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
          },
          "title": "A String", # The subscription's title.
          "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
            "kind": "A String", # The type of the API resource.
            "channelId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.
            "playlistId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.
            "videoId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.
          },
          "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
          "publishedAt": "A String", # The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
          "channelTitle": "A String", # Channel title for the channel that the subscription belongs to.
          "description": "A String", # The subscription's details.
        },
        "etag": "A String", # Etag of this resource.
        "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the sbuscriber.
          "title": "A String", # The title of the subscriber.
          "channelId": "A String", # The channel ID of the subscriber.
          "description": "A String", # The description of the subscriber.
          "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
            "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
            "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
              "url": "A String", # The thumbnail image's URL.
              "width": 42, # (Optional) Width of the thumbnail image.
              "height": 42, # (Optional) Height of the thumbnail image.
            },
          },
        },
        "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
      }

    Returns:
      An object of the form:

        { # A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
          "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
          "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
            "newItemCount": 42, # The number of new items in the subscription since its content was last read.
            "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
            "totalItemCount": 42, # The approximate number of items that the subscription points to.
          },
          "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
            "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.
              "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
            },
            "title": "A String", # The subscription's title.
            "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
              "kind": "A String", # The type of the API resource.
              "channelId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.
              "playlistId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.
              "videoId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.
            },
            "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
            "publishedAt": "A String", # The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
            "channelTitle": "A String", # Channel title for the channel that the subscription belongs to.
            "description": "A String", # The subscription's details.
          },
          "etag": "A String", # Etag of this resource.
          "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the sbuscriber.
            "title": "A String", # The title of the subscriber.
            "channelId": "A String", # The channel ID of the subscriber.
            "description": "A String", # The description of the subscriber.
            "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
              "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
              "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
                "url": "A String", # The thumbnail image's URL.
                "width": 42, # (Optional) Width of the thumbnail image.
                "height": 42, # (Optional) Height of the thumbnail image.
              },
            },
          },
          "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
        }

`list(part=None, channelId=None, mine=None, mySubscribers=None, id=None, onBehalfOfContentOwner=None, pageToken=None, forChannelId=None, onBehalfOfContentOwnerChannel=None, maxResults=None, order=None)`

    Returns subscription resources that match the API request criteria.

    Args:
      part: string, The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.

    If the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties. (required)
      channelId: string, The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.
      mine: boolean, Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.
      mySubscribers: boolean, Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user.
      id: string, The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.
      onBehalfOfContentOwner: string, Note: This parameter is intended exclusively for YouTube content partners.

    The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.
      pageToken: string, The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
      forChannelId: string, The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.
      onBehalfOfContentOwnerChannel: string, This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.

    The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.

    This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.
      maxResults: integer, The maxResults parameter specifies the maximum number of items that should be returned in the result set.
      order: string, The order parameter specifies the method that will be used to sort resources in the API response.
        Allowed values
          alphabetical - Sort alphabetically.
          relevance - Sort by relevance.
          unread - Sort by order of activity.

    Returns:
      An object of the form:

        {
        "eventId": "A String", # Serialized EventId of the request which produced this response.
        "nextPageToken": "A String", # The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set.
        "kind": "youtube#subscriptionListResponse", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscriptionListResponse".
        "visitorId": "A String", # The visitorId identifies the visitor.
        "items": [ # A list of subscriptions that match the request criteria.
          { # A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.
              "kind": "youtube#subscription", # Identifies what kind of resource this is. Value: the fixed string "youtube#subscription".
              "contentDetails": { # Details about the content to witch a subscription refers. # The contentDetails object contains basic statistics about the subscription.
                "newItemCount": 42, # The number of new items in the subscription since its content was last read.
                "activityType": "A String", # The type of activity this subscription is for (only uploads, everything).
                "totalItemCount": 42, # The approximate number of items that the subscription points to.
              },
              "snippet": { # Basic details about a subscription, including title, description and thumbnails of the subscribed item. # The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to.
                "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail.
                  "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                },
                "title": "A String", # The subscription's title.
                "resourceId": { # A resource id is a generic reference that points to another YouTube resource. # The id object contains information about the channel that the user subscribed to.
                  "kind": "A String", # The type of the API resource.
                  "channelId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel.
                  "playlistId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist.
                  "videoId": "A String", # The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video.
                },
                "channelId": "A String", # The ID that YouTube uses to uniquely identify the subscriber's channel.
                "publishedAt": "A String", # The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
                "channelTitle": "A String", # Channel title for the channel that the subscription belongs to.
                "description": "A String", # The subscription's details.
              },
              "etag": "A String", # Etag of this resource.
              "subscriberSnippet": { # Basic details about a subscription's subscriber including title, description, channel ID and thumbnails. # The subscriberSnippet object contains basic details about the sbuscriber.
                "title": "A String", # The title of the subscriber.
                "channelId": "A String", # The channel ID of the subscriber.
                "description": "A String", # The description of the subscriber.
                "thumbnails": { # Internal representation of thumbnails for a YouTube resource. # Thumbnails for this subscriber.
                  "default": { # A thumbnail is an image representing a YouTube resource. # The default image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "high": { # A thumbnail is an image representing a YouTube resource. # The high quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "medium": { # A thumbnail is an image representing a YouTube resource. # The medium quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "maxres": { # A thumbnail is an image representing a YouTube resource. # The maximum resolution quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                  "standard": { # A thumbnail is an image representing a YouTube resource. # The standard quality image for this resource.
                    "url": "A String", # The thumbnail image's URL.
                    "width": 42, # (Optional) Width of the thumbnail image.
                    "height": 42, # (Optional) Height of the thumbnail image.
                  },
                },
              },
              "id": "A String", # The ID that YouTube uses to uniquely identify the subscription.
            },
        ],
        "tokenPagination": { # Stub token pagination template to suppress results.
        },
        "etag": "A String", # Etag of this resource.
        "prevPageToken": "A String", # The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set.
        "pageInfo": { # Paging details for lists of resources, including total number of items available and number of resources returned in a single page.
          "totalResults": 42, # The total number of results in the result set.
          "resultsPerPage": 42, # The number of results included in the API response.
        },
      }

`list_next(previous_request, previous_response)`

    Retrieves the next page of results.

    Args:
      previous_request: The request for the previous page. (required)
      previous_response: The response from the request for the previous page. (required)

    Returns:
      A request object that you can call 'execute()' on to request the next
      page. Returns None if there are no more items in the collection.