diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index c4e029ab..7478dc09 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -7,6 +7,7 @@ docs/AdditionalDenialReason.md docs/Address.md docs/AnswerCallback.md docs/AsyncLookupRequest.md +docs/AttestationLevelEnum.md docs/BlockedWebhook.md docs/BridgeCompleteCallback.md docs/BridgeTargetCompleteCallback.md @@ -255,6 +256,7 @@ src/Bandwidth.Standard/Model/AdditionalDenialReason.cs src/Bandwidth.Standard/Model/Address.cs src/Bandwidth.Standard/Model/AnswerCallback.cs src/Bandwidth.Standard/Model/AsyncLookupRequest.cs +src/Bandwidth.Standard/Model/AttestationLevelEnum.cs src/Bandwidth.Standard/Model/BlockedWebhook.cs src/Bandwidth.Standard/Model/BridgeCompleteCallback.cs src/Bandwidth.Standard/Model/BridgeTargetCompleteCallback.cs diff --git a/README.md b/README.md index 7802e79a..19d280e4 100644 --- a/README.md +++ b/README.md @@ -175,6 +175,7 @@ Class | Method | HTTP request | Description - [Model.Address](docs/Address.md) - [Model.AnswerCallback](docs/AnswerCallback.md) - [Model.AsyncLookupRequest](docs/AsyncLookupRequest.md) + - [Model.AttestationLevelEnum](docs/AttestationLevelEnum.md) - [Model.BlockedWebhook](docs/BlockedWebhook.md) - [Model.BridgeCompleteCallback](docs/BridgeCompleteCallback.md) - [Model.BridgeTargetCompleteCallback](docs/BridgeTargetCompleteCallback.md) diff --git a/api/openapi.yaml b/api/openapi.yaml index 7f2f5e33..e3249e2d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -10983,6 +10983,15 @@ components: - segmentCount - time - to + attestationLevelEnum: + description: "The STIR/SHAKEN attestation level Bandwidth signs the call with:\ + \ `A` (full), `B` (partial), or `C` (gateway)." + enum: + - A + - B + - C + example: B + type: string callbackMethodEnum: default: POST description: The HTTP method to use to deliver the callback. GET or POST. Default @@ -11126,6 +11135,33 @@ components: example: "eyJhbGciOiJIUzI1NiJ9.WyJoaSJd.-znkjYyCkgz4djmHUPSXl9YrJ6Nix_XvmlwKGFh5ERM;encoding=jwt,aGVsbG8gd29ybGQ;encoding=base64" nullable: true type: string + requestedAttestationLevel: + 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`. + nullable: true + identity: + 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" + maxLength: 2000 + minLength: 1 + nullable: true + pattern: "^ *[A-Za-z0-9\\-_.+/=;:<>\"][A-Za-z0-9\\-_.+/=;:<>\" ]*$" + type: string applicationId: description: The id of the application associated with the `from` number. example: 1234-qwer-5679-tyui @@ -11265,12 +11301,14 @@ components: accountId: "9900000" password: mySecretPassword1! answerMethod: POST + identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" enqueuedTime: 2022-06-16T13:15:07.16Z disconnectUrl: https://myServer.example/bandwidth/webhooks/disconnect from: "+19195554321" fallbackPassword: mySecretPassword1! to: "+19195551234" tag: My custom tag value + requestedAttestationLevel: "" applicationId: 04e88489-df02-4e34-a0ee-27a91849555f username: mySecretUsername fallbackUsername: mySecretUsername @@ -11375,6 +11413,19 @@ components: example: 5 nullable: true type: integer + requestedAttestationLevel: + 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. + nullable: true + identity: + description: "The `identity` value provided in the Create Call request,\ + \ if any." + example: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=;alg=ES256;ppt="shaken" + nullable: true + type: string required: - accountId - answerMethod diff --git a/bandwidth.yml b/bandwidth.yml index bffc6469..b88af843 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/AttestationLevelEnum.md b/docs/AttestationLevelEnum.md new file mode 100644 index 00000000..6cd8e6b4 --- /dev/null +++ b/docs/AttestationLevelEnum.md @@ -0,0 +1,10 @@ +# Bandwidth.Standard.Model.AttestationLevelEnum +The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/CreateCall.md b/docs/CreateCall.md index 2ed6cdbd..9f7885f8 100644 --- a/docs/CreateCall.md +++ b/docs/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] **DisplayName** | **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] +**RequestedAttestationLevel** | **AttestationLevelEnum** | 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] **ApplicationId** | **string** | The id of the application associated with the `from` number. | **AnswerUrl** | **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`. | **AnswerMethod** | **CallbackMethodEnum** | | [optional] diff --git a/docs/CreateCallResponse.md b/docs/CreateCallResponse.md index efede270..d1989f25 100644 --- a/docs/CreateCallResponse.md +++ b/docs/CreateCallResponse.md @@ -25,6 +25,8 @@ Name | Type | Description | Notes **FallbackUsername** | **string** | Basic auth username. | [optional] **FallbackPassword** | **string** | Basic auth password. | [optional] **Priority** | **int?** | The priority of this call over other calls from your account. | [optional] +**RequestedAttestationLevel** | **AttestationLevelEnum** | 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#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/src/Bandwidth.Standard.Test/Unit/Api/CallsApiTests.cs b/src/Bandwidth.Standard.Test/Unit/Api/CallsApiTests.cs index fc41d74c..222153be 100644 --- a/src/Bandwidth.Standard.Test/Unit/Api/CallsApiTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Api/CallsApiTests.cs @@ -38,6 +38,7 @@ public class CallsApiTests : IDisposable private readonly CallbackMethodEnum disconnectMethod = CallbackMethodEnum.GET; private readonly double callTimeout = 30.0; private readonly double callbackTimeout = 15.0; + private readonly string identity = "eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\""; public CallsApiTests() { @@ -93,7 +94,9 @@ public void CreateCallTest() disconnectMethod: disconnectMethod, machineDetection: machineDetection, callTimeout: callTimeout, - callbackTimeout: callbackTimeout + callbackTimeout: callbackTimeout, + requestedAttestationLevel: AttestationLevelEnum.B, + identity: identity ); ApiResponse response = instance.CreateCallWithHttpInfo(accountId, createCall); diff --git a/src/Bandwidth.Standard.Test/Unit/Model/AttestationLevelEnumTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/AttestationLevelEnumTests.cs new file mode 100644 index 00000000..f475b515 --- /dev/null +++ b/src/Bandwidth.Standard.Test/Unit/Model/AttestationLevelEnumTests.cs @@ -0,0 +1,54 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using Xunit; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using Bandwidth.Standard.Model; +using Bandwidth.Standard.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace Bandwidth.Standard.Test.Unit.Model +{ + /// + /// Class for testing AttestationLevelEnum + /// + public class AttestationLevelEnumTests : IDisposable + { + private AttestationLevelEnum instance; + + public AttestationLevelEnumTests() + { + instance = new AttestationLevelEnum(); + } + + public void Dispose() + { + // Cleanup when everything is done. + } + + /// + /// Test an instance of AttestationLevelEnum + /// + [Fact] + public void AttestationLevelEnumInstanceTest() + { + Assert.IsType(instance); + Assert.Equal("A", AttestationLevelEnum.A.ToString()); + Assert.Equal("B", AttestationLevelEnum.B.ToString()); + Assert.Equal("C", AttestationLevelEnum.C.ToString()); + } + } +} diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs index db9fdee1..bbf25968 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallResponseTests.cs @@ -52,7 +52,9 @@ public CreateCallResponseTests() password: "password", fallbackUsername: "fallbackUsername", fallbackPassword: "fallbackPassword", - priority: 1 + priority: 1, + requestedAttestationLevel: AttestationLevelEnum.B, + identity: "eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\"" ); } @@ -261,6 +263,25 @@ public void PriorityTest() Assert.Equal(1, instance.Priority); } + /// + /// Test the property 'RequestedAttestationLevel' + /// + [Fact] + public void RequestedAttestationLevelTest() + { + Assert.IsType(instance.RequestedAttestationLevel); + Assert.Equal(AttestationLevelEnum.B, instance.RequestedAttestationLevel); + } + /// + /// Test the property 'Identity' + /// + [Fact] + public void IdentityTest() + { + Assert.IsType(instance.Identity); + Assert.Equal("eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\"", instance.Identity); + } + } } diff --git a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs index 3c3f8182..e84a7e47 100644 --- a/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs +++ b/src/Bandwidth.Standard.Test/Unit/Model/CreateCallTests.cs @@ -51,6 +51,8 @@ public CreateCallTests() answerUrl: "https://www.myCallbackServer.example/webhooks/answer", displayName: "John Doe", uui: "1234567890abcdef", + requestedAttestationLevel: AttestationLevelEnum.B, + identity: "eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\"", answerMethod: CallbackMethodEnum.POST, username: "username", password: "password", @@ -120,6 +122,24 @@ public void UuiTest() Assert.Equal("1234567890abcdef", instance.Uui); } /// + /// Test the property 'RequestedAttestationLevel' + /// + [Fact] + public void RequestedAttestationLevelTest() + { + Assert.IsType(instance.RequestedAttestationLevel); + Assert.Equal(AttestationLevelEnum.B, instance.RequestedAttestationLevel); + } + /// + /// Test the property 'Identity' + /// + [Fact] + public void IdentityTest() + { + Assert.IsType(instance.Identity); + Assert.Equal("eyJhbGciOiJFUzI1NiJ9.eyJhdHRlc3QiOiJBIn0.c2ln;info=;alg=ES256;ppt=\"shaken\"", instance.Identity); + } + /// /// Test the property 'ApplicationId' /// [Fact] diff --git a/src/Bandwidth.Standard/Model/AttestationLevelEnum.cs b/src/Bandwidth.Standard/Model/AttestationLevelEnum.cs new file mode 100644 index 00000000..526c0269 --- /dev/null +++ b/src/Bandwidth.Standard/Model/AttestationLevelEnum.cs @@ -0,0 +1,55 @@ +/* + * Bandwidth + * + * Bandwidth's Communication APIs + * + * The version of the OpenAPI document: 1.0.0 + * Contact: letstalk@bandwidth.com + * Generated by: https://github.com/openapitools/openapi-generator.git + */ + + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using System.IO; +using System.Runtime.Serialization; +using System.Text; +using System.Text.RegularExpressions; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; +using System.ComponentModel.DataAnnotations; +using OpenAPIDateConverter = Bandwidth.Standard.Client.OpenAPIDateConverter; + +namespace Bandwidth.Standard.Model +{ + /// + /// The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + /// + /// The STIR/SHAKEN attestation level Bandwidth signs the call with: `A` (full), `B` (partial), or `C` (gateway). + [JsonConverter(typeof(StringEnumConverter))] + public enum AttestationLevelEnum + { + /// + /// Enum A for value: A + /// + [EnumMember(Value = "A")] + A = 1, + + /// + /// Enum B for value: B + /// + [EnumMember(Value = "B")] + B = 2, + + /// + /// Enum C for value: C + /// + [EnumMember(Value = "C")] + C = 3 + } + +} diff --git a/src/Bandwidth.Standard/Model/CreateCall.cs b/src/Bandwidth.Standard/Model/CreateCall.cs index c1ff7bd5..fdf845ea 100644 --- a/src/Bandwidth.Standard/Model/CreateCall.cs +++ b/src/Bandwidth.Standard/Model/CreateCall.cs @@ -33,6 +33,13 @@ namespace Bandwidth.Standard.Model public partial class CreateCall : IValidatableObject { + /// + /// 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`. + /// + /// 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`. + [DataMember(Name = "requestedAttestationLevel", EmitDefaultValue = true)] + public AttestationLevelEnum? RequestedAttestationLevel { get; set; } + /// /// Gets or Sets AnswerMethod /// @@ -63,6 +70,8 @@ protected CreateCall() { } /// Hide the calling number. The `displayName` field can be used to customize the displayed name.. /// 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`.. /// 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.. + /// 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`.. + /// 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`.. /// The id of the application associated with the `from` number. (required). /// 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`. (required). /// answerMethod. @@ -79,7 +88,7 @@ protected CreateCall() { } /// machineDetection. /// The priority of this call over other calls from your account. For example, if during a call your application needs to place a new call and bridge it with the current call, you might want to create the call with priority 1 so that it will be the next call picked off your queue, ahead of other less time sensitive calls. A lower value means higher priority, so a priority 1 call takes precedence over a priority 2 call. (default to 5). /// A custom string that will be sent with all webhooks for this call unless overwritten by a future <a href='/docs/voice/bxml/tag'>`<Tag>`</a> verb or `tag` attribute on another verb, or cleared. May be cleared by setting `tag=\"\"` Max length 4096 characters.. - public CreateCall(string to = default(string), string from = default(string), bool? privacy = default(bool?), string displayName = default(string), string uui = default(string), string applicationId = default(string), string answerUrl = default(string), CallbackMethodEnum? answerMethod = default(CallbackMethodEnum?), string username = default(string), string password = default(string), string answerFallbackUrl = default(string), CallbackMethodEnum? answerFallbackMethod = default(CallbackMethodEnum?), string fallbackUsername = default(string), string fallbackPassword = default(string), string disconnectUrl = default(string), CallbackMethodEnum? disconnectMethod = default(CallbackMethodEnum?), double? callTimeout = 30D, double? callbackTimeout = 15D, MachineDetectionConfiguration machineDetection = default(MachineDetectionConfiguration), int? priority = 5, string tag = default(string)) + public CreateCall(string to = default(string), string from = default(string), bool? privacy = default(bool?), string displayName = default(string), string uui = default(string), AttestationLevelEnum? requestedAttestationLevel = default(AttestationLevelEnum?), string identity = default(string), string applicationId = default(string), string answerUrl = default(string), CallbackMethodEnum? answerMethod = default(CallbackMethodEnum?), string username = default(string), string password = default(string), string answerFallbackUrl = default(string), CallbackMethodEnum? answerFallbackMethod = default(CallbackMethodEnum?), string fallbackUsername = default(string), string fallbackPassword = default(string), string disconnectUrl = default(string), CallbackMethodEnum? disconnectMethod = default(CallbackMethodEnum?), double? callTimeout = 30D, double? callbackTimeout = 15D, MachineDetectionConfiguration machineDetection = default(MachineDetectionConfiguration), int? priority = 5, string tag = default(string)) { // to ensure "to" is required (not null) if (to == null) @@ -108,6 +117,8 @@ protected CreateCall() { } this.Privacy = privacy; this.DisplayName = displayName; this.Uui = uui; + this.RequestedAttestationLevel = requestedAttestationLevel; + this.Identity = identity; this.AnswerMethod = answerMethod; this.Username = username; this.Password = password; @@ -167,6 +178,14 @@ protected CreateCall() { } [DataMember(Name = "uui", EmitDefaultValue = true)] public string Uui { get; set; } + /// + /// 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`. + /// + /// 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`. + /// eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken" + [DataMember(Name = "identity", EmitDefaultValue = true)] + public string Identity { get; set; } + /// /// The id of the application associated with the `from` number. /// @@ -282,6 +301,8 @@ public override string ToString() sb.Append(" Privacy: ").Append(Privacy).Append("\n"); sb.Append(" DisplayName: ").Append(DisplayName).Append("\n"); sb.Append(" Uui: ").Append(Uui).Append("\n"); + sb.Append(" RequestedAttestationLevel: ").Append(RequestedAttestationLevel).Append("\n"); + sb.Append(" Identity: ").Append(Identity).Append("\n"); sb.Append(" ApplicationId: ").Append(ApplicationId).Append("\n"); sb.Append(" AnswerUrl: ").Append(AnswerUrl).Append("\n"); sb.Append(" AnswerMethod: ").Append(AnswerMethod).Append("\n"); @@ -324,6 +345,27 @@ IEnumerable IValidatableObject.Validate(ValidationContext vali yield return new ValidationResult("Invalid value for DisplayName, length must be less than 256.", new [] { "DisplayName" }); } + // Identity (string) maxLength + if (this.Identity != null && this.Identity.Length > 2000) + { + yield return new ValidationResult("Invalid value for Identity, length must be less than 2000.", new [] { "Identity" }); + } + + // Identity (string) minLength + if (this.Identity != null && this.Identity.Length < 1) + { + yield return new ValidationResult("Invalid value for Identity, length must be greater than 1.", new [] { "Identity" }); + } + + if (this.Identity != null) { + // Identity (string) pattern + Regex regexIdentity = new Regex(@"^ *[A-Za-z0-9\-_.+/=;:<>""][A-Za-z0-9\-_.+/=;:<>"" ]*$", RegexOptions.CultureInvariant); + if (!regexIdentity.Match(this.Identity).Success) + { + yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Identity, must match a pattern of " + regexIdentity, new [] { "Identity" }); + } + } + // AnswerUrl (string) maxLength if (this.AnswerUrl != null && this.AnswerUrl.Length > 2048) { diff --git a/src/Bandwidth.Standard/Model/CreateCallResponse.cs b/src/Bandwidth.Standard/Model/CreateCallResponse.cs index deee97fa..4f7ea05a 100644 --- a/src/Bandwidth.Standard/Model/CreateCallResponse.cs +++ b/src/Bandwidth.Standard/Model/CreateCallResponse.cs @@ -50,6 +50,13 @@ public partial class CreateCallResponse : IValidatableObject /// [DataMember(Name = "disconnectMethod", IsRequired = true, EmitDefaultValue = true)] public CallbackMethodEnum DisconnectMethod { get; set; } + + /// + /// 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. + /// + /// 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. + [DataMember(Name = "requestedAttestationLevel", EmitDefaultValue = true)] + public AttestationLevelEnum? RequestedAttestationLevel { get; set; } /// /// Initializes a new instance of the class. /// @@ -79,7 +86,9 @@ protected CreateCallResponse() { } /// Basic auth username.. /// Basic auth password.. /// The priority of this call over other calls from your account.. - public CreateCallResponse(string applicationId = default(string), string accountId = default(string), string callId = default(string), string to = default(string), string from = default(string), DateTime? enqueuedTime = default(DateTime?), string callUrl = default(string), double callTimeout = default(double), double callbackTimeout = default(double), string tag = default(string), CallbackMethodEnum answerMethod = default(CallbackMethodEnum), string answerUrl = default(string), CallbackMethodEnum? answerFallbackMethod = default(CallbackMethodEnum?), string answerFallbackUrl = default(string), CallbackMethodEnum disconnectMethod = default(CallbackMethodEnum), string disconnectUrl = default(string), string username = default(string), string password = default(string), string fallbackUsername = default(string), string fallbackPassword = default(string), int? priority = default(int?)) + /// 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.. + /// The `identity` value provided in the Create Call request, if any.. + public CreateCallResponse(string applicationId = default(string), string accountId = default(string), string callId = default(string), string to = default(string), string from = default(string), DateTime? enqueuedTime = default(DateTime?), string callUrl = default(string), double callTimeout = default(double), double callbackTimeout = default(double), string tag = default(string), CallbackMethodEnum answerMethod = default(CallbackMethodEnum), string answerUrl = default(string), CallbackMethodEnum? answerFallbackMethod = default(CallbackMethodEnum?), string answerFallbackUrl = default(string), CallbackMethodEnum disconnectMethod = default(CallbackMethodEnum), string disconnectUrl = default(string), string username = default(string), string password = default(string), string fallbackUsername = default(string), string fallbackPassword = default(string), int? priority = default(int?), AttestationLevelEnum? requestedAttestationLevel = default(AttestationLevelEnum?), string identity = default(string)) { // to ensure "applicationId" is required (not null) if (applicationId == null) @@ -137,6 +146,8 @@ protected CreateCallResponse() { } this.FallbackUsername = fallbackUsername; this.FallbackPassword = fallbackPassword; this.Priority = priority; + this.RequestedAttestationLevel = requestedAttestationLevel; + this.Identity = identity; } /// @@ -283,6 +294,14 @@ protected CreateCallResponse() { } [DataMember(Name = "priority", EmitDefaultValue = true)] public int? Priority { get; set; } + /// + /// The `identity` value provided in the Create Call request, if any. + /// + /// The `identity` value provided in the Create Call request, if any. + /// eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUvY2VydC5wZW0ifQ.eyJhdHRlc3QiOiJBIiwiZGVzdCI6eyJ0biI6WyIxOTE5NTU1MTIzNCJdfSwiaWF0IjoxNzAwMDAwMDAwLCJvcmlnIjp7InRuIjoiMTU1NTU1NTEyMTIifSwib3JpZ2lkIjoiMTIzNCJ9.c2lnbmF0dXJl;info=<https://cert.example/cert.pem>;alg=ES256;ppt="shaken" + [DataMember(Name = "identity", EmitDefaultValue = true)] + public string Identity { get; set; } + /// /// Returns the string presentation of the object /// @@ -312,6 +331,8 @@ public override string ToString() sb.Append(" FallbackUsername: ").Append(FallbackUsername).Append("\n"); sb.Append(" FallbackPassword: ").Append(FallbackPassword).Append("\n"); sb.Append(" Priority: ").Append(Priority).Append("\n"); + sb.Append(" RequestedAttestationLevel: ").Append(RequestedAttestationLevel).Append("\n"); + sb.Append(" Identity: ").Append(Identity).Append("\n"); sb.Append("}\n"); return sb.ToString(); }