-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
250 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
namespace AsyncAws\MediaConvert\Enum; | ||
|
||
/** | ||
* Specify which SPEKE version 2.0 audio preset MediaConvert uses to request content keys from your SPEKE server. For | ||
* more information, see: https://docs.aws.amazon.com/mediaconvert/latest/ug/drm-content-speke-v2-presets.html To | ||
* encrypt to your audio outputs, choose from the following: Audio preset 1, Audio preset 2, or Audio preset 3. To | ||
* encrypt your audio outputs, using the same content key for both your audio and video outputs: Choose Shared. When you | ||
* do, you must also set SPEKE v2.0 video preset to Shared. To not encrypt your audio outputs: Choose Unencrypted. When | ||
* you do, to encrypt your video outputs, you must also specify a SPEKE v2.0 video preset (other than Shared or | ||
* Unencrypted). | ||
*/ | ||
final class PresetSpeke20Audio | ||
{ | ||
public const PRESET_AUDIO_1 = 'PRESET_AUDIO_1'; | ||
public const PRESET_AUDIO_2 = 'PRESET_AUDIO_2'; | ||
public const PRESET_AUDIO_3 = 'PRESET_AUDIO_3'; | ||
public const SHARED = 'SHARED'; | ||
public const UNENCRYPTED = 'UNENCRYPTED'; | ||
|
||
public static function exists(string $value): bool | ||
{ | ||
return isset([ | ||
self::PRESET_AUDIO_1 => true, | ||
self::PRESET_AUDIO_2 => true, | ||
self::PRESET_AUDIO_3 => true, | ||
self::SHARED => true, | ||
self::UNENCRYPTED => true, | ||
][$value]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace AsyncAws\MediaConvert\Enum; | ||
|
||
/** | ||
* Specify which SPEKE version 2.0 video preset MediaConvert uses to request content keys from your SPEKE server. For | ||
* more information, see: https://docs.aws.amazon.com/mediaconvert/latest/ug/drm-content-speke-v2-presets.html To | ||
* encrypt to your video outputs, choose from the following: Video preset 1, Video preset 2, Video preset 3, Video | ||
* preset 4, Video preset 5, Video preset 6, Video preset 7, or Video preset 8. To encrypt your video outputs, using the | ||
* same content key for both your video and audio outputs: Choose Shared. When you do, you must also set SPEKE v2.0 | ||
* audio preset to Shared. To not encrypt your video outputs: Choose Unencrypted. When you do, to encrypt your audio | ||
* outputs, you must also specify a SPEKE v2.0 audio preset (other than Shared or Unencrypted). | ||
*/ | ||
final class PresetSpeke20Video | ||
{ | ||
public const PRESET_VIDEO_1 = 'PRESET_VIDEO_1'; | ||
public const PRESET_VIDEO_2 = 'PRESET_VIDEO_2'; | ||
public const PRESET_VIDEO_3 = 'PRESET_VIDEO_3'; | ||
public const PRESET_VIDEO_4 = 'PRESET_VIDEO_4'; | ||
public const PRESET_VIDEO_5 = 'PRESET_VIDEO_5'; | ||
public const PRESET_VIDEO_6 = 'PRESET_VIDEO_6'; | ||
public const PRESET_VIDEO_7 = 'PRESET_VIDEO_7'; | ||
public const PRESET_VIDEO_8 = 'PRESET_VIDEO_8'; | ||
public const SHARED = 'SHARED'; | ||
public const UNENCRYPTED = 'UNENCRYPTED'; | ||
|
||
public static function exists(string $value): bool | ||
{ | ||
return isset([ | ||
self::PRESET_VIDEO_1 => true, | ||
self::PRESET_VIDEO_2 => true, | ||
self::PRESET_VIDEO_3 => true, | ||
self::PRESET_VIDEO_4 => true, | ||
self::PRESET_VIDEO_5 => true, | ||
self::PRESET_VIDEO_6 => true, | ||
self::PRESET_VIDEO_7 => true, | ||
self::PRESET_VIDEO_8 => true, | ||
self::SHARED => true, | ||
self::UNENCRYPTED => true, | ||
][$value]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<?php | ||
|
||
namespace AsyncAws\MediaConvert\ValueObject; | ||
|
||
use AsyncAws\Core\Exception\InvalidArgument; | ||
use AsyncAws\MediaConvert\Enum\PresetSpeke20Audio; | ||
use AsyncAws\MediaConvert\Enum\PresetSpeke20Video; | ||
|
||
/** | ||
* Specify the SPEKE version, either v1.0 or v2.0, that MediaConvert uses when encrypting your output. For more | ||
* information, see: https://docs.aws.amazon.com/speke/latest/documentation/speke-api-specification.html To use SPEKE | ||
* v1.0: Leave blank. To use SPEKE v2.0: Specify a SPEKE v2.0 video preset and a SPEKE v2.0 audio preset. | ||
*/ | ||
final class EncryptionContractConfiguration | ||
{ | ||
/** | ||
* Specify which SPEKE version 2.0 audio preset MediaConvert uses to request content keys from your SPEKE server. For | ||
* more information, see: https://docs.aws.amazon.com/mediaconvert/latest/ug/drm-content-speke-v2-presets.html To | ||
* encrypt to your audio outputs, choose from the following: Audio preset 1, Audio preset 2, or Audio preset 3. To | ||
* encrypt your audio outputs, using the same content key for both your audio and video outputs: Choose Shared. When you | ||
* do, you must also set SPEKE v2.0 video preset to Shared. To not encrypt your audio outputs: Choose Unencrypted. When | ||
* you do, to encrypt your video outputs, you must also specify a SPEKE v2.0 video preset (other than Shared or | ||
* Unencrypted). | ||
* | ||
* @var PresetSpeke20Audio::*|null | ||
*/ | ||
private $spekeAudioPreset; | ||
|
||
/** | ||
* Specify which SPEKE version 2.0 video preset MediaConvert uses to request content keys from your SPEKE server. For | ||
* more information, see: https://docs.aws.amazon.com/mediaconvert/latest/ug/drm-content-speke-v2-presets.html To | ||
* encrypt to your video outputs, choose from the following: Video preset 1, Video preset 2, Video preset 3, Video | ||
* preset 4, Video preset 5, Video preset 6, Video preset 7, or Video preset 8. To encrypt your video outputs, using the | ||
* same content key for both your video and audio outputs: Choose Shared. When you do, you must also set SPEKE v2.0 | ||
* audio preset to Shared. To not encrypt your video outputs: Choose Unencrypted. When you do, to encrypt your audio | ||
* outputs, you must also specify a SPEKE v2.0 audio preset (other than Shared or Unencrypted). | ||
* | ||
* @var PresetSpeke20Video::*|null | ||
*/ | ||
private $spekeVideoPreset; | ||
|
||
/** | ||
* @param array{ | ||
* SpekeAudioPreset?: null|PresetSpeke20Audio::*, | ||
* SpekeVideoPreset?: null|PresetSpeke20Video::*, | ||
* } $input | ||
*/ | ||
public function __construct(array $input) | ||
{ | ||
$this->spekeAudioPreset = $input['SpekeAudioPreset'] ?? null; | ||
$this->spekeVideoPreset = $input['SpekeVideoPreset'] ?? null; | ||
} | ||
|
||
/** | ||
* @param array{ | ||
* SpekeAudioPreset?: null|PresetSpeke20Audio::*, | ||
* SpekeVideoPreset?: null|PresetSpeke20Video::*, | ||
* }|EncryptionContractConfiguration $input | ||
*/ | ||
public static function create($input): self | ||
{ | ||
return $input instanceof self ? $input : new self($input); | ||
} | ||
|
||
/** | ||
* @return PresetSpeke20Audio::*|null | ||
*/ | ||
public function getSpekeAudioPreset(): ?string | ||
{ | ||
return $this->spekeAudioPreset; | ||
} | ||
|
||
/** | ||
* @return PresetSpeke20Video::*|null | ||
*/ | ||
public function getSpekeVideoPreset(): ?string | ||
{ | ||
return $this->spekeVideoPreset; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
public function requestBody(): array | ||
{ | ||
$payload = []; | ||
if (null !== $v = $this->spekeAudioPreset) { | ||
if (!PresetSpeke20Audio::exists($v)) { | ||
throw new InvalidArgument(\sprintf('Invalid parameter "spekeAudioPreset" for "%s". The value "%s" is not a valid "PresetSpeke20Audio".', __CLASS__, $v)); | ||
} | ||
$payload['spekeAudioPreset'] = $v; | ||
} | ||
if (null !== $v = $this->spekeVideoPreset) { | ||
if (!PresetSpeke20Video::exists($v)) { | ||
throw new InvalidArgument(\sprintf('Invalid parameter "spekeVideoPreset" for "%s". The value "%s" is not a valid "PresetSpeke20Video".', __CLASS__, $v)); | ||
} | ||
$payload['spekeVideoPreset'] = $v; | ||
} | ||
|
||
return $payload; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.