gleetube/resource/channels

Types

Filter for channels.list — exactly one filter must be specified. Enforced at compile time as a required argument.

pub type ChannelFilter {
  ById(ids: List(String))
  ByHandle(handle: String)
  ByUsername(username: String)
  Mine
  ManagedByMe
}

Constructors

  • ById(ids: List(String))

    Filter by one or more channel IDs.

  • ByHandle(handle: String)

    Filter by YouTube handle (with or without @ prefix).

  • ByUsername(username: String)

    Filter by YouTube username.

  • Mine

    Return only the authenticated user’s channel (requires OAuth2).

  • ManagedByMe

    Return channels managed by the authenticated content owner.

Valid part values for the channels resource.

pub type ChannelPart {
  AuditDetails
  BrandingSettings
  ContentDetails
  ContentOwnerDetails
  Id
  Localizations
  Snippet
  Statistics
  Status
  TopicDetails
}

Constructors

  • AuditDetails
  • BrandingSettings
  • ContentDetails
  • ContentOwnerDetails
  • Id
  • Localizations
  • Snippet
  • Statistics
  • Status
  • TopicDetails

Values

pub fn list(
  client: client.Client,
  parts parts: List(ChannelPart),
  filter filter: ChannelFilter,
  max_results max_results: option.Option(Int),
  page_token page_token: option.Option(String),
  hl hl: option.Option(String),
) -> Result(channel.ChannelListResponse, error.GleeTubeError)

List channels matching the given filter.

Example

client
|> channels.list(
  parts: [Snippet, Statistics],
  filter: ById(["UC_x5XG1OV2P6uZZ5FSM9Ttw"]),
  max_results: option.None,
  page_token: option.None,
  hl: option.None,
)
pub fn list_all(
  client: client.Client,
  parts parts: List(ChannelPart),
  filter filter: ChannelFilter,
  hl hl: option.Option(String),
) -> Result(List(channel.Channel), error.GleeTubeError)

Fetch all channels across all pages.

pub fn update(
  client: client.Client,
  part part: ChannelPart,
  body body: json.Json,
  on_behalf_of_content_owner on_behalf_of_content_owner: option.Option(
    String,
  ),
) -> Result(channel.Channel, error.GleeTubeError)

Update a channel’s metadata. The part parameter specifies which part is being updated.

Search Document