# 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", # The kind, fixed to "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", # The kind, fixed to "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, pageToken=None, id=None, channelId=None, mine=None, maxResults=None, forChannelId=None, mySubscribers=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)
      pageToken: string, USE_DESCRIPTION --- channels:list:pageToken
      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.
      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.
      maxResults: integer, USE_DESCRIPTION --- channels:list:maxResults
      forChannelId: string, The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.
      mySubscribers: boolean, Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user.
      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:

        { # A paginated list of subscriptions returned as the response to a youtube.subscriptions.list call.
        "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", # The type of the API response. For this operation, the value will be 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", # The kind, fixed to "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.
            },
        ],
        "etag": "A String", # The ETag of the response.
        "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. # The pageInfo object encapsulates paging information for the result set.
          "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.