diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0c639e6..0586da6 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -21,6 +21,7 @@ docs/Model/AdditionalDenialReason.md docs/Model/Address.md docs/Model/AnswerCallback.md docs/Model/AsyncLookupRequest.md +docs/Model/AttestationLevelEnum.md docs/Model/BlockedWebhook.md docs/Model/BridgeCompleteCallback.md docs/Model/BridgeTargetCompleteCallback.md @@ -242,6 +243,7 @@ src/Model/Address.php src/Model/AnswerCallback.php src/Model/AnyOfInterface.php src/Model/AsyncLookupRequest.php +src/Model/AttestationLevelEnum.php src/Model/BlockedWebhook.php src/Model/BridgeCompleteCallback.php src/Model/BridgeTargetCompleteCallback.php diff --git a/README.md b/README.md index 719ef43..870f8b2 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ Class | Method | HTTP request | Description - [Address](docs/Model/Address.md) - [AnswerCallback](docs/Model/AnswerCallback.md) - [AsyncLookupRequest](docs/Model/AsyncLookupRequest.md) +- [AttestationLevelEnum](docs/Model/AttestationLevelEnum.md) - [BlockedWebhook](docs/Model/BlockedWebhook.md) - [BridgeCompleteCallback](docs/Model/BridgeCompleteCallback.md) - [BridgeTargetCompleteCallback](docs/Model/BridgeTargetCompleteCallback.md) diff --git a/bandwidth.yml b/bandwidth.yml index bffc646..b88af84 100644 --- a/bandwidth.yml +++ b/bandwidth.yml @@ -3241,6 +3241,16 @@ components: - direction - to - from + attestationLevelEnum: + type: string + enum: + - A + - B + - C + description: >- + The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` + (full), `B` (partial), or `C` (gateway). + example: B callbackMethodEnum: type: string nullable: true @@ -3419,6 +3429,52 @@ components: entire value cannot exceed 350 characters, including parameters and separators. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request + Bandwidth sign this call with. + + Applies to outbound calls to US destinations only, and only to + accounts that use the + + Hosted + Signing Service; it is ignored + + for all other accounts. If omitted, the attestation policy + configured on your account is used. + + + Cannot be combined with `identity`. A request that includes both is + rejected with a `400`, as is + + any value other than `A`, `B`, or `C`. + identity: + nullable: true + type: string + minLength: 1 + maxLength: 2000 + pattern: ^ *[A-Za-z0-9\-_.+/=;:<>"][A-Za-z0-9\-_.+/=;:<>" ]*$ + description: >- + A complete SIP `Identity` header value that you signed yourself. It + must be a valid STIR/SHAKEN + + PASSporT and may not exceed 2000 characters. Bandwidth sends it + unmodified on the outbound call and + + does not sign the call. Bandwidth checks only the format and size of + the value, not the signature. + + Applies to outbound calls to US destinations only. + + + Cannot be combined with `requestedAttestationLevel`. A request that + includes both, or a value that is too long + + or not in the expected format, is rejected with a `400`. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" applicationId: type: string description: The id of the application associated with the `from` number. @@ -3688,6 +3744,20 @@ components: type: integer example: 5 description: The priority of this call over other calls from your account. + requestedAttestationLevel: + nullable: true + allOf: + - $ref: '#/components/schemas/attestationLevelEnum' + description: >- + The `requestedAttestationLevel` provided in the Create Call request, + if any. This is the level you requested, + + which can differ from the level the call is ultimately signed with. + identity: + nullable: true + type: string + description: The `identity` value provided in the Create Call request, if any. + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" callState: type: object properties: diff --git a/docs/Model/AttestationLevelEnum.md b/docs/Model/AttestationLevelEnum.md new file mode 100644 index 0000000..4cc8fed --- /dev/null +++ b/docs/Model/AttestationLevelEnum.md @@ -0,0 +1,8 @@ +# AttestationLevelEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCall.md b/docs/Model/CreateCall.md index 08fc238..c3c8ca2 100644 --- a/docs/Model/CreateCall.md +++ b/docs/Model/CreateCall.md @@ -9,6 +9,8 @@ Name | Type | Description | Notes **privacy** | **bool** | Hide the calling number. The `displayName` field can be used to customize the displayed name. | [optional] **display_name** | **string** | The caller display name to use when the call is created. May not exceed 256 characters nor contain control characters such as new lines. If `privacy` is true, only the following values are valid: `Restricted`, `Anonymous`, `Private`, or `Unavailable`. | [optional] **uui** | **string** | A comma-separated list of 'User-To-User' headers to be sent in the INVITE when calling a SIP URI. Each value must end with an 'encoding' parameter as described in <a href='https://tools.ietf.org/html/rfc7433'>RFC 7433</a>. Only 'jwt', 'base64' and 'hex' encodings are allowed. The entire value cannot exceed 350 characters, including parameters and separators. | [optional] +**requested_attestation_level** | [**\Bandwidth\Model\AttestationLevelEnum**](AttestationLevelEnum.md) | The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the <a href='/docs/voice/stir-shaken/hosted-signing-service'>Hosted Signing Service</a>; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. | [optional] +**identity** | **string** | A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. | [optional] **application_id** | **string** | The id of the application associated with the `from` number. | **answer_url** | **string** | The full URL to send the <a href='/docs/voice/webhooks/answer'>Answer</a> event to when the called party answers. This endpoint should return the first <a href='/docs/voice/bxml'>BXML document</a> to be executed in the call. Must use `https` if specifying `username` and `password`. | **answer_method** | [**\Bandwidth\Model\CallbackMethodEnum**](CallbackMethodEnum.md) | | [optional] diff --git a/docs/Model/CreateCallResponse.md b/docs/Model/CreateCallResponse.md index 9d8b465..9246b1b 100644 --- a/docs/Model/CreateCallResponse.md +++ b/docs/Model/CreateCallResponse.md @@ -25,5 +25,7 @@ Name | Type | Description | Notes **fallback_username** | **string** | Basic auth username. | [optional] **fallback_password** | **string** | Basic auth password. | [optional] **priority** | **int** | The priority of this call over other calls from your account. | [optional] +**requested_attestation_level** | [**\Bandwidth\Model\AttestationLevelEnum**](AttestationLevelEnum.md) | The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. | [optional] +**identity** | **string** | The `identity` value provided in the Create Call request, if any. | [optional] [[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/src/Model/AttestationLevelEnum.php b/src/Model/AttestationLevelEnum.php new file mode 100644 index 0000000..b93eaae --- /dev/null +++ b/src/Model/AttestationLevelEnum.php @@ -0,0 +1,48 @@ + 'bool', 'display_name' => 'string', 'uui' => 'string', + 'requested_attestation_level' => '\Bandwidth\Model\AttestationLevelEnum', + 'identity' => 'string', 'application_id' => 'string', 'answer_url' => 'string', 'answer_method' => '\Bandwidth\Model\CallbackMethodEnum', @@ -93,6 +95,8 @@ class CreateCall implements ModelInterface, ArrayAccess, JsonSerializable 'privacy' => null, 'display_name' => null, 'uui' => null, + 'requested_attestation_level' => null, + 'identity' => null, 'application_id' => null, 'answer_url' => 'uri', 'answer_method' => null, @@ -122,6 +126,8 @@ class CreateCall implements ModelInterface, ArrayAccess, JsonSerializable 'privacy' => true, 'display_name' => true, 'uui' => true, + 'requested_attestation_level' => true, + 'identity' => true, 'application_id' => false, 'answer_url' => false, 'answer_method' => true, @@ -221,6 +227,8 @@ public function isNullableSetToNull(string $property): bool 'privacy' => 'privacy', 'display_name' => 'displayName', 'uui' => 'uui', + 'requested_attestation_level' => 'requestedAttestationLevel', + 'identity' => 'identity', 'application_id' => 'applicationId', 'answer_url' => 'answerUrl', 'answer_method' => 'answerMethod', @@ -250,6 +258,8 @@ public function isNullableSetToNull(string $property): bool 'privacy' => 'setPrivacy', 'display_name' => 'setDisplayName', 'uui' => 'setUui', + 'requested_attestation_level' => 'setRequestedAttestationLevel', + 'identity' => 'setIdentity', 'application_id' => 'setApplicationId', 'answer_url' => 'setAnswerUrl', 'answer_method' => 'setAnswerMethod', @@ -279,6 +289,8 @@ public function isNullableSetToNull(string $property): bool 'privacy' => 'getPrivacy', 'display_name' => 'getDisplayName', 'uui' => 'getUui', + 'requested_attestation_level' => 'getRequestedAttestationLevel', + 'identity' => 'getIdentity', 'application_id' => 'getApplicationId', 'answer_url' => 'getAnswerUrl', 'answer_method' => 'getAnswerMethod', @@ -349,6 +361,8 @@ public function __construct(?array $data = null) $this->setIfExists('privacy', $data ?? [], null); $this->setIfExists('display_name', $data ?? [], null); $this->setIfExists('uui', $data ?? [], null); + $this->setIfExists('requested_attestation_level', $data ?? [], null); + $this->setIfExists('identity', $data ?? [], null); $this->setIfExists('application_id', $data ?? [], null); $this->setIfExists('answer_url', $data ?? [], null); $this->setIfExists('answer_method', $data ?? [], null); @@ -402,6 +416,18 @@ public function listInvalidProperties(): array $invalidProperties[] = "invalid value for 'display_name', the character length must be smaller than or equal to 256."; } + if (!is_null($this->container['identity']) && (mb_strlen($this->container['identity']) > 2000)) { + $invalidProperties[] = "invalid value for 'identity', the character length must be smaller than or equal to 2000."; + } + + if (!is_null($this->container['identity']) && (mb_strlen($this->container['identity']) < 1)) { + $invalidProperties[] = "invalid value for 'identity', the character length must be bigger than or equal to 1."; + } + + if (!is_null($this->container['identity']) && !preg_match("/^ *[A-Za-z0-9\\-_.+\/=;:<>\"][A-Za-z0-9\\-_.+\/=;:<>\" ]*$/", $this->container['identity'])) { + $invalidProperties[] = "invalid value for 'identity', must be conform to the pattern /^ *[A-Za-z0-9\\-_.+\/=;:<>\"][A-Za-z0-9\\-_.+\/=;:<>\" ]*$/."; + } + if ($this->container['application_id'] === null) { $invalidProperties[] = "'application_id' can't be null"; } @@ -636,6 +662,84 @@ public function setUui(?string $uui): static return $this; } + /** + * Gets requested_attestation_level + * + * @return \Bandwidth\Model\AttestationLevelEnum|null + */ + public function getRequestedAttestationLevel(): ?\Bandwidth\Model\AttestationLevelEnum + { + return $this->container['requested_attestation_level']; + } + + /** + * Sets requested_attestation_level + * + * @param \Bandwidth\Model\AttestationLevelEnum|null $requested_attestation_level The STIR/SHAKEN attestation level (`A`, `B`, or `C`) you request Bandwidth sign this call with. Applies to outbound calls to US destinations only, and only to accounts that use the Hosted Signing Service; it is ignored for all other accounts. If omitted, the attestation policy configured on your account is used. Cannot be combined with `identity`. A request that includes both is rejected with a `400`, as is any value other than `A`, `B`, or `C`. + * + * @return $this + */ + public function setRequestedAttestationLevel(?\Bandwidth\Model\AttestationLevelEnum $requested_attestation_level): static + { + if (is_null($requested_attestation_level)) { + array_push($this->openAPINullablesSetToNull, 'requested_attestation_level'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('requested_attestation_level', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['requested_attestation_level'] = $requested_attestation_level; + + return $this; + } + + /** + * Gets identity + * + * @return string|null + */ + public function getIdentity(): ?string + { + return $this->container['identity']; + } + + /** + * Sets identity + * + * @param string|null $identity A complete SIP `Identity` header value that you signed yourself. It must be a valid STIR/SHAKEN PASSporT and may not exceed 2000 characters. Bandwidth sends it unmodified on the outbound call and does not sign the call. Bandwidth checks only the format and size of the value, not the signature. Applies to outbound calls to US destinations only. Cannot be combined with `requestedAttestationLevel`. A request that includes both, or a value that is too long or not in the expected format, is rejected with a `400`. + * + * @return $this + */ + public function setIdentity(?string $identity): static + { + if (is_null($identity)) { + array_push($this->openAPINullablesSetToNull, 'identity'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('identity', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + if (!is_null($identity) && (mb_strlen($identity) > 2000)) { + throw new InvalidArgumentException('invalid length for $identity when calling CreateCall., must be smaller than or equal to 2000.'); + } + if (!is_null($identity) && (mb_strlen($identity) < 1)) { + throw new InvalidArgumentException('invalid length for $identity when calling CreateCall., must be bigger than or equal to 1.'); + } + if (!is_null($identity) && (!preg_match("/^ *[A-Za-z0-9\\-_.+\/=;:<>\"][A-Za-z0-9\\-_.+\/=;:<>\" ]*$/", ObjectSerializer::toString($identity)))) { + throw new InvalidArgumentException("invalid value for \$identity when calling CreateCall., must conform to the pattern /^ *[A-Za-z0-9\\-_.+\/=;:<>\"][A-Za-z0-9\\-_.+\/=;:<>\" ]*$/."); + } + + $this->container['identity'] = $identity; + + return $this; + } + /** * Gets application_id * diff --git a/src/Model/CreateCallResponse.php b/src/Model/CreateCallResponse.php index 8afc737..b9c1171 100644 --- a/src/Model/CreateCallResponse.php +++ b/src/Model/CreateCallResponse.php @@ -79,7 +79,9 @@ class CreateCallResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'password' => 'string', 'fallback_username' => 'string', 'fallback_password' => 'string', - 'priority' => 'int' + 'priority' => 'int', + 'requested_attestation_level' => '\Bandwidth\Model\AttestationLevelEnum', + 'identity' => 'string' ]; /** @@ -108,7 +110,9 @@ class CreateCallResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'password' => null, 'fallback_username' => null, 'fallback_password' => null, - 'priority' => null + 'priority' => null, + 'requested_attestation_level' => null, + 'identity' => null ]; /** @@ -137,7 +141,9 @@ class CreateCallResponse implements ModelInterface, ArrayAccess, JsonSerializabl 'password' => true, 'fallback_username' => true, 'fallback_password' => true, - 'priority' => true + 'priority' => true, + 'requested_attestation_level' => true, + 'identity' => true ]; /** @@ -236,7 +242,9 @@ public function isNullableSetToNull(string $property): bool 'password' => 'password', 'fallback_username' => 'fallbackUsername', 'fallback_password' => 'fallbackPassword', - 'priority' => 'priority' + 'priority' => 'priority', + 'requested_attestation_level' => 'requestedAttestationLevel', + 'identity' => 'identity' ]; /** @@ -265,7 +273,9 @@ public function isNullableSetToNull(string $property): bool 'password' => 'setPassword', 'fallback_username' => 'setFallbackUsername', 'fallback_password' => 'setFallbackPassword', - 'priority' => 'setPriority' + 'priority' => 'setPriority', + 'requested_attestation_level' => 'setRequestedAttestationLevel', + 'identity' => 'setIdentity' ]; /** @@ -294,7 +304,9 @@ public function isNullableSetToNull(string $property): bool 'password' => 'getPassword', 'fallback_username' => 'getFallbackUsername', 'fallback_password' => 'getFallbackPassword', - 'priority' => 'getPriority' + 'priority' => 'getPriority', + 'requested_attestation_level' => 'getRequestedAttestationLevel', + 'identity' => 'getIdentity' ]; /** @@ -365,6 +377,8 @@ public function __construct(?array $data = null) $this->setIfExists('fallback_username', $data ?? [], null); $this->setIfExists('fallback_password', $data ?? [], null); $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('requested_attestation_level', $data ?? [], null); + $this->setIfExists('identity', $data ?? [], null); } /** @@ -1113,6 +1127,74 @@ public function setPriority(?int $priority): static return $this; } + + /** + * Gets requested_attestation_level + * + * @return \Bandwidth\Model\AttestationLevelEnum|null + */ + public function getRequestedAttestationLevel(): ?\Bandwidth\Model\AttestationLevelEnum + { + return $this->container['requested_attestation_level']; + } + + /** + * Sets requested_attestation_level + * + * @param \Bandwidth\Model\AttestationLevelEnum|null $requested_attestation_level The `requestedAttestationLevel` provided in the Create Call request, if any. This is the level you requested, which can differ from the level the call is ultimately signed with. + * + * @return $this + */ + public function setRequestedAttestationLevel(?\Bandwidth\Model\AttestationLevelEnum $requested_attestation_level): static + { + if (is_null($requested_attestation_level)) { + array_push($this->openAPINullablesSetToNull, 'requested_attestation_level'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('requested_attestation_level', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['requested_attestation_level'] = $requested_attestation_level; + + return $this; + } + + /** + * Gets identity + * + * @return string|null + */ + public function getIdentity(): ?string + { + return $this->container['identity']; + } + + /** + * Sets identity + * + * @param string|null $identity The `identity` value provided in the Create Call request, if any. + * + * @return $this + */ + public function setIdentity(?string $identity): static + { + if (is_null($identity)) { + array_push($this->openAPINullablesSetToNull, 'identity'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('identity', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['identity'] = $identity; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/tests/Unit/Api/CallsApiTest.php b/tests/Unit/Api/CallsApiTest.php index 196cb73..7e64783 100644 --- a/tests/Unit/Api/CallsApiTest.php +++ b/tests/Unit/Api/CallsApiTest.php @@ -29,6 +29,7 @@ use Bandwidth\Configuration; use Bandwidth\Api\CallsApi; +use Bandwidth\Model\AttestationLevelEnum; use Bandwidth\Model\CallbackMethodEnum; use Bandwidth\Model\CallDirectionEnum; use Bandwidth\Model\CallState; @@ -105,7 +106,9 @@ public function testCreateCall() 'disconnect_method' => self::$disconnect_method, 'machine_detection' => $machine_detection, 'call_timeout' => self::$call_timeout, - 'callback_timeout' => self::$callback_timeout + 'callback_timeout' => self::$callback_timeout, + 'requested_attestation_level' => AttestationLevelEnum::B, + 'identity' => 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"' ]); [$data, $status_code] = self::$apiInstance->createCallWithHttpInfo( diff --git a/tests/Unit/Model/AttestationLevelEnumTest.php b/tests/Unit/Model/AttestationLevelEnumTest.php new file mode 100644 index 0000000..73612a8 --- /dev/null +++ b/tests/Unit/Model/AttestationLevelEnumTest.php @@ -0,0 +1,56 @@ +assertSame( + ['A', 'B', 'C'], + array_column(AttestationLevelEnum::cases(), 'value') + ); + } +} diff --git a/tests/Unit/Model/CreateCallResponseTest.php b/tests/Unit/Model/CreateCallResponseTest.php index c59d360..bc2ecbd 100644 --- a/tests/Unit/Model/CreateCallResponseTest.php +++ b/tests/Unit/Model/CreateCallResponseTest.php @@ -28,6 +28,7 @@ namespace Bandwidth\Test\Unit\Model; +use Bandwidth\Model\AttestationLevelEnum; use Bandwidth\Model\CallbackMethodEnum; use Bandwidth\Model\CreateCallResponse; @@ -71,7 +72,9 @@ public static function setUpBeforeClass(): void 'password' => 'test_string', 'fallback_username' => 'test_string', 'fallback_password' => 'test_string', - 'priority' => 1 + 'priority' => 1, + 'requested_attestation_level' => AttestationLevelEnum::B, + 'identity' => 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"' ]); } @@ -270,4 +273,22 @@ public function testPropertyPriority() { $this->assertIsInt(self::$instance->getPriority()); $this->assertEquals(1, self::$instance->getPriority()); + } + + /** + * Test attribute "requested_attestation_level" + */ + public function testPropertyRequestedAttestationLevel() + { + $this->assertInstanceOf(AttestationLevelEnum::class, self::$instance->getRequestedAttestationLevel()); + $this->assertSame(AttestationLevelEnum::B, self::$instance->getRequestedAttestationLevel()); + } + + /** + * Test attribute "identity" + */ + public function testPropertyIdentity() + { + $this->assertIsString(self::$instance->getIdentity()); + $this->assertEquals('eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"', self::$instance->getIdentity()); }} diff --git a/tests/Unit/Model/CreateCallTest.php b/tests/Unit/Model/CreateCallTest.php index d814df3..b47a600 100644 --- a/tests/Unit/Model/CreateCallTest.php +++ b/tests/Unit/Model/CreateCallTest.php @@ -28,6 +28,7 @@ namespace Bandwidth\Test\Unit\Model; +use Bandwidth\Model\AttestationLevelEnum; use Bandwidth\Model\CallbackMethodEnum; use Bandwidth\Model\CreateCall; use Bandwidth\Model\MachineDetectionConfiguration; @@ -57,6 +58,8 @@ public static function setUpBeforeClass(): void 'privacy' => true, 'display_name' => 'test_string', 'uui' => 'test_string', + 'requested_attestation_level' => AttestationLevelEnum::B, + 'identity' => 'eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"', 'application_id' => 'test_string', 'answer_url' => 'test_string', 'answer_method' => CallbackMethodEnum::GET, @@ -129,6 +132,24 @@ public function testPropertyUui() $this->assertEquals('test_string', self::$instance->getUui()); } + /** + * Test attribute "requested_attestation_level" + */ + public function testPropertyRequestedAttestationLevel() + { + $this->assertInstanceOf(AttestationLevelEnum::class, self::$instance->getRequestedAttestationLevel()); + $this->assertSame(AttestationLevelEnum::B, self::$instance->getRequestedAttestationLevel()); + } + + /** + * Test attribute "identity" + */ + public function testPropertyIdentity() + { + $this->assertIsString(self::$instance->getIdentity()); + $this->assertEquals('eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt="shaken"', self::$instance->getIdentity()); + } + /** * Test attribute "application_id" */ @@ -270,4 +291,5 @@ public function testPropertyTag() { $this->assertIsString(self::$instance->getTag()); $this->assertEquals('test_string', self::$instance->getTag()); - }} + } +}