Skip to content

Commit 0ea8e93

Browse files
band-swi-release-engineering[bot]DX-Bandwidthckoegel
authored
SWI-10974 Update SDK Based on Recent Spec Changes (#188)
* Generate SDK with OpenAPI Generator Version * unit test --------- Co-authored-by: DX-Bandwidth <dx@bandwidth.com> Co-authored-by: ckoegel <ckoegel1006@gmail.com>
1 parent 7bd4c07 commit 0ea8e93

8 files changed

Lines changed: 81 additions & 9 deletions

File tree

Bandwidth.Standard.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 14
33
VisualStudioVersion = 14.0.25420.1
44
MinimumVisualStudioVersion = 10.0.40219.1
5-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{E14115CA-15F6-4B76-873A-2BCF556F002C}"
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard", "src\Bandwidth.Standard\Bandwidth.Standard.csproj", "{28C13A04-5CB0-4AAA-B6F3-16A3A8496C30}"
66
EndProject
77
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bandwidth.Standard.Test", "src\Bandwidth.Standard.Test\Bandwidth.Standard.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
88
EndProject
@@ -12,10 +12,10 @@ Global
1212
Release|Any CPU = Release|Any CPU
1313
EndGlobalSection
1414
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15-
{E14115CA-15F6-4B76-873A-2BCF556F002C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16-
{E14115CA-15F6-4B76-873A-2BCF556F002C}.Debug|Any CPU.Build.0 = Debug|Any CPU
17-
{E14115CA-15F6-4B76-873A-2BCF556F002C}.Release|Any CPU.ActiveCfg = Release|Any CPU
18-
{E14115CA-15F6-4B76-873A-2BCF556F002C}.Release|Any CPU.Build.0 = Release|Any CPU
15+
{28C13A04-5CB0-4AAA-B6F3-16A3A8496C30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{28C13A04-5CB0-4AAA-B6F3-16A3A8496C30}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{28C13A04-5CB0-4AAA-B6F3-16A3A8496C30}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{28C13A04-5CB0-4AAA-B6F3-16A3A8496C30}.Release|Any CPU.Build.0 = Release|Any CPU
1919
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2020
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
2121
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU

api/openapi.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6723,6 +6723,13 @@ components:
67236723
phoneNumbers:
67246724
- "+19196104423"
67256725
- "+19196104424"
6726+
rcsAgentRequestExample:
6727+
summary: Number Lookup Request with Custom RCS Agent
6728+
value:
6729+
phoneNumbers:
6730+
- "+19196104423"
6731+
- "+19196104424"
6732+
rcsAgent: MyCustomRcsAgent
67266733
lookupAcceptedExample:
67276734
summary: Numbers Lookup Accepted
67286735
value:
@@ -8099,6 +8106,8 @@ components:
80998106
$ref: '#/components/examples/singleNumberRequestExample'
81008107
multipleNumberRequestExample:
81018108
$ref: '#/components/examples/multipleNumberRequestExample'
8109+
rcsAgentRequestExample:
8110+
$ref: '#/components/examples/rcsAgentRequestExample'
81028111
schema:
81038112
$ref: '#/components/schemas/syncLookupRequest'
81048113
description: Synchronous phone number lookup request.
@@ -14315,6 +14324,14 @@ components:
1431514324
maximum: 100
1431614325
minimum: 1
1431714326
type: array
14327+
rcsAgent:
14328+
description: |-
14329+
Override the default RCS sender/agent ID used when checking RCS capabilities.
14330+
When provided, this value is used as the `sender` in the RCS capability-check request instead of the account default.
14331+
Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.
14332+
example: MyCustomRcsAgent
14333+
pattern: "^[A-Za-z0-9_-]{1,40}$"
14334+
type: string
1431814335
required:
1431914336
- phoneNumbers
1432014337
type: object

bandwidth.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5759,6 +5759,19 @@ components:
57595759
items:
57605760
type: string
57615761
pattern: ^\+[1-9]\d{1,14}$
5762+
rcsAgent:
5763+
type: string
5764+
description: >-
5765+
Override the default RCS sender/agent ID used when checking RCS
5766+
capabilities.
5767+
5768+
When provided, this value is used as the `sender` in the RCS
5769+
capability-check request instead of the account default.
5770+
5771+
Must be 1–40 characters and contain only letters, digits,
5772+
underscores, or hyphens.
5773+
pattern: ^[A-Za-z0-9_-]{1,40}$
5774+
example: MyCustomRcsAgent
57625775
required:
57635776
- phoneNumbers
57645777
asyncLookupRequest:
@@ -8758,6 +8771,13 @@ components:
87588771
phoneNumbers:
87598772
- '+19196104423'
87608773
- '+19196104424'
8774+
rcsAgentRequestExample:
8775+
summary: Number Lookup Request with Custom RCS Agent
8776+
value:
8777+
phoneNumbers:
8778+
- '+19196104423'
8779+
- '+19196104424'
8780+
rcsAgent: MyCustomRcsAgent
87618781
lookupAcceptedExample:
87628782
summary: Numbers Lookup Accepted
87638783
value:
@@ -9518,6 +9538,8 @@ components:
95189538
$ref: '#/components/examples/singleNumberRequestExample'
95199539
multipleNumberRequestExample:
95209540
$ref: '#/components/examples/multipleNumberRequestExample'
9541+
rcsAgentRequestExample:
9542+
$ref: '#/components/examples/rcsAgentRequestExample'
95219543
createAsyncBulkLookupRequest:
95229544
description: Asynchronous bulk phone number lookup request.
95239545
required: true

docs/SyncLookupRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**PhoneNumbers** | **List&lt;string&gt;** | Telephone numbers in E.164 format. |
8+
**RcsAgent** | **string** | Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens. | [optional]
89

910
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1011

src/Bandwidth.Standard.Test/Unit/Model/SyncLookupRequestTests.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public class SyncLookupRequestTests : IDisposable
3636
public SyncLookupRequestTests()
3737
{
3838
instance = new SyncLookupRequest(
39-
phoneNumbers: new List<string> { "1234567890", "0987654321" }
39+
phoneNumbers: new List<string> { "1234567890", "0987654321" },
40+
rcsAgent: "TestAgent"
4041
);
4142
}
4243

@@ -63,5 +64,16 @@ public void PhoneNumbersTest()
6364
Assert.IsType<List<string>>(instance.PhoneNumbers);
6465
Assert.Equal(new List<string> { "1234567890", "0987654321" }, instance.PhoneNumbers);
6566
}
67+
68+
69+
/// <summary>
70+
/// Test the property 'RcsAgent'
71+
/// </summary>
72+
[Fact]
73+
public void RcsAgentTest()
74+
{
75+
Assert.IsType<string>(instance.RcsAgent);
76+
Assert.Equal("TestAgent", instance.RcsAgent);
77+
}
6678
}
6779
}

src/Bandwidth.Standard/Model/RbmActionBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ protected RbmActionBase() { }
7878
/// Base64 payload the customer receives when the reply is clicked.
7979
/// </summary>
8080
/// <value>Base64 payload the customer receives when the reply is clicked.</value>
81-
/// <example>[B@73bcd9b4</example>
81+
/// <example>[B@6a9ac8b</example>
8282
[DataMember(Name = "postbackData", IsRequired = true, EmitDefaultValue = true)]
8383
public byte[] PostbackData { get; set; }
8484

src/Bandwidth.Standard/Model/RbmSuggestionResponse.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public partial class RbmSuggestionResponse : IValidatableObject
5555
/// Base64 payload the customer receives when the reply is clicked.
5656
/// </summary>
5757
/// <value>Base64 payload the customer receives when the reply is clicked.</value>
58-
/// <example>[B@73bcd9b4</example>
58+
/// <example>[B@6a9ac8b</example>
5959
[DataMember(Name = "postbackData", EmitDefaultValue = false)]
6060
public byte[] PostbackData { get; set; }
6161

src/Bandwidth.Standard/Model/SyncLookupRequest.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,16 @@ protected SyncLookupRequest() { }
4141
/// Initializes a new instance of the <see cref="SyncLookupRequest" /> class.
4242
/// </summary>
4343
/// <param name="phoneNumbers">Telephone numbers in E.164 format. (required).</param>
44-
public SyncLookupRequest(List<string> phoneNumbers = default(List<string>))
44+
/// <param name="rcsAgent">Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens..</param>
45+
public SyncLookupRequest(List<string> phoneNumbers = default(List<string>), string rcsAgent = default(string))
4546
{
4647
// to ensure "phoneNumbers" is required (not null)
4748
if (phoneNumbers == null)
4849
{
4950
throw new ArgumentNullException("phoneNumbers is a required property for SyncLookupRequest and cannot be null");
5051
}
5152
this.PhoneNumbers = phoneNumbers;
53+
this.RcsAgent = rcsAgent;
5254
}
5355

5456
/// <summary>
@@ -58,6 +60,14 @@ protected SyncLookupRequest() { }
5860
[DataMember(Name = "phoneNumbers", IsRequired = true, EmitDefaultValue = true)]
5961
public List<string> PhoneNumbers { get; set; }
6062

63+
/// <summary>
64+
/// Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.
65+
/// </summary>
66+
/// <value>Override the default RCS sender/agent ID used when checking RCS capabilities. When provided, this value is used as the &#x60;sender&#x60; in the RCS capability-check request instead of the account default. Must be 1–40 characters and contain only letters, digits, underscores, or hyphens.</value>
67+
/// <example>MyCustomRcsAgent</example>
68+
[DataMember(Name = "rcsAgent", EmitDefaultValue = false)]
69+
public string RcsAgent { get; set; }
70+
6171
/// <summary>
6272
/// Returns the string presentation of the object
6373
/// </summary>
@@ -67,6 +77,7 @@ public override string ToString()
6777
StringBuilder sb = new StringBuilder();
6878
sb.Append("class SyncLookupRequest {\n");
6979
sb.Append(" PhoneNumbers: ").Append(PhoneNumbers).Append("\n");
80+
sb.Append(" RcsAgent: ").Append(RcsAgent).Append("\n");
7081
sb.Append("}\n");
7182
return sb.ToString();
7283
}
@@ -87,6 +98,15 @@ public virtual string ToJson()
8798
/// <returns>Validation Result</returns>
8899
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
89100
{
101+
if (this.RcsAgent != null) {
102+
// RcsAgent (string) pattern
103+
Regex regexRcsAgent = new Regex(@"^[A-Za-z0-9_-]{1,40}$", RegexOptions.CultureInvariant);
104+
if (!regexRcsAgent.Match(this.RcsAgent).Success)
105+
{
106+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for RcsAgent, must match a pattern of " + regexRcsAgent, new [] { "RcsAgent" });
107+
}
108+
}
109+
90110
yield break;
91111
}
92112
}

0 commit comments

Comments
 (0)