createOriginEndpoint method

Future<CreateOriginEndpointResponse> createOriginEndpoint({
  1. required String channelId,
  2. required String id,
  3. Authorization? authorization,
  4. CmafPackageCreateOrUpdateParameters? cmafPackage,
  5. DashPackage? dashPackage,
  6. String? description,
  7. HlsPackage? hlsPackage,
  8. String? manifestName,
  9. MssPackage? mssPackage,
  10. Origination? origination,
  11. int? startoverWindowSeconds,
  12. Map<String, String>? tags,
  13. int? timeDelaySeconds,
  14. List<String>? whitelist,
})

Creates a new OriginEndpoint record.

May throw UnprocessableEntityException. May throw InternalServerErrorException. May throw ForbiddenException. May throw NotFoundException. May throw ServiceUnavailableException. May throw TooManyRequestsException.

Parameter channelId : The ID of the Channel that the OriginEndpoint will be associated with. This cannot be changed after the OriginEndpoint is created.

Parameter id : The ID of the OriginEndpoint. The ID must be unique within the region and it cannot be changed after the OriginEndpoint is created.

Parameter description : A short text description of the OriginEndpoint.

Parameter manifestName : A short string that will be used as the filename of the OriginEndpoint URL (defaults to "index").

Parameter origination : Control whether origination of video is allowed for this OriginEndpoint. If set to ALLOW, the OriginEndpoint may by requested, pursuant to any other form of access control. If set to DENY, the OriginEndpoint may not be requested. This can be helpful for Live to VOD harvesting, or for temporarily disabling origination

Parameter startoverWindowSeconds : Maximum duration (seconds) of content to retain for startover playback. If not specified, startover playback will be disabled for the OriginEndpoint.

Parameter timeDelaySeconds : Amount of delay (seconds) to enforce on the playback of live content. If not specified, there will be no time delay in effect for the OriginEndpoint.

Parameter whitelist : A list of source IP CIDR blocks that will be allowed to access the OriginEndpoint.

Implementation

Future<CreateOriginEndpointResponse> createOriginEndpoint({
  required String channelId,
  required String id,
  Authorization? authorization,
  CmafPackageCreateOrUpdateParameters? cmafPackage,
  DashPackage? dashPackage,
  String? description,
  HlsPackage? hlsPackage,
  String? manifestName,
  MssPackage? mssPackage,
  Origination? origination,
  int? startoverWindowSeconds,
  Map<String, String>? tags,
  int? timeDelaySeconds,
  List<String>? whitelist,
}) async {
  ArgumentError.checkNotNull(channelId, 'channelId');
  ArgumentError.checkNotNull(id, 'id');
  final $payload = <String, dynamic>{
    'channelId': channelId,
    'id': id,
    if (authorization != null) 'authorization': authorization,
    if (cmafPackage != null) 'cmafPackage': cmafPackage,
    if (dashPackage != null) 'dashPackage': dashPackage,
    if (description != null) 'description': description,
    if (hlsPackage != null) 'hlsPackage': hlsPackage,
    if (manifestName != null) 'manifestName': manifestName,
    if (mssPackage != null) 'mssPackage': mssPackage,
    if (origination != null) 'origination': origination.toValue(),
    if (startoverWindowSeconds != null)
      'startoverWindowSeconds': startoverWindowSeconds,
    if (tags != null) 'tags': tags,
    if (timeDelaySeconds != null) 'timeDelaySeconds': timeDelaySeconds,
    if (whitelist != null) 'whitelist': whitelist,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/origin_endpoints',
    exceptionFnMap: _exceptionFns,
  );
  return CreateOriginEndpointResponse.fromJson(response);
}