createSourceLocation method

Future<CreateSourceLocationResponse> createSourceLocation({
  1. required HttpConfiguration httpConfiguration,
  2. required String sourceLocationName,
  3. AccessConfiguration? accessConfiguration,
  4. DefaultSegmentDeliveryConfiguration? defaultSegmentDeliveryConfiguration,
  5. List<SegmentDeliveryConfiguration>? segmentDeliveryConfigurations,
  6. Map<String, String>? tags,
})

Creates a source location. A source location is a container for sources. For more information about source locations, see Working with source locations in the MediaTailor User Guide.

Parameter httpConfiguration : The source's HTTP package configurations.

Parameter sourceLocationName : The name associated with the source location.

Parameter accessConfiguration : Access configuration parameters. Configures the type of authentication used to access content from your source location.

Parameter defaultSegmentDeliveryConfiguration : The optional configuration for the server that serves segments.

Parameter segmentDeliveryConfigurations : A list of the segment delivery configurations associated with this resource.

Parameter tags : The tags to assign to the source location. Tags are key-value pairs that you can associate with Amazon resources to help with organization, access control, and cost tracking. For more information, see Tagging AWS Elemental MediaTailor Resources.

Implementation

Future<CreateSourceLocationResponse> createSourceLocation({
  required HttpConfiguration httpConfiguration,
  required String sourceLocationName,
  AccessConfiguration? accessConfiguration,
  DefaultSegmentDeliveryConfiguration? defaultSegmentDeliveryConfiguration,
  List<SegmentDeliveryConfiguration>? segmentDeliveryConfigurations,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'HttpConfiguration': httpConfiguration,
    if (accessConfiguration != null)
      'AccessConfiguration': accessConfiguration,
    if (defaultSegmentDeliveryConfiguration != null)
      'DefaultSegmentDeliveryConfiguration':
          defaultSegmentDeliveryConfiguration,
    if (segmentDeliveryConfigurations != null)
      'SegmentDeliveryConfigurations': segmentDeliveryConfigurations,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/sourceLocation/${Uri.encodeComponent(sourceLocationName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSourceLocationResponse.fromJson(response);
}