list method

Future<ThirdPartyLinkListResponse> list(
  1. List<String> part, {
  2. String? externalChannelId,
  3. String? linkingToken,
  4. String? type,
  5. String? $fields,
})

Retrieves a list of resources, possibly filtered.

Request parameters:

part - The part parameter specifies the thirdPartyLink resource parts that the API response will include. Supported values are linkingToken, status, and snippet.

externalChannelId - Channel ID to which changes should be applied, for delegation.

linkingToken - Get a third party link with the given linking token.

type - Get a third party link of the given type. Possible string values are:

  • "linkUnspecified"
  • "channelToStoreLink" : A link that is connecting (or about to connect) a channel with a store on a merchandising platform in order to enable retail commerce capabilities for that channel on YouTube.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ThirdPartyLinkListResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ThirdPartyLinkListResponse> list(
  core.List<core.String> part, {
  core.String? externalChannelId,
  core.String? linkingToken,
  core.String? type,
  core.String? $fields,
}) async {
  if (part.isEmpty) {
    throw core.ArgumentError('Parameter part cannot be empty.');
  }
  final queryParams_ = <core.String, core.List<core.String>>{
    'part': part,
    if (externalChannelId != null) 'externalChannelId': [externalChannelId],
    if (linkingToken != null) 'linkingToken': [linkingToken],
    if (type != null) 'type': [type],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'youtube/v3/thirdPartyLinks';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ThirdPartyLinkListResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}