-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Bandwidth/release/2021-03-08-21-40-18
webrtc new field
- Loading branch information
Showing
4 changed files
with
103 additions
and
16 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,79 @@ | ||
/* | ||
* Bandwidth.Standard | ||
* | ||
* This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). | ||
*/ | ||
using System; | ||
using System.Linq; | ||
using System.Collections.Generic; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
using Bandwidth.Standard; | ||
using Bandwidth.Standard.Utilities; | ||
|
||
namespace Bandwidth.Standard.WebRtc.Models | ||
{ | ||
[JsonConverter(typeof(StringValuedEnumConverter))] | ||
public enum DeviceApiVersionEnum | ||
{ | ||
V3, | ||
V2, | ||
} | ||
|
||
/// <summary> | ||
/// Helper for the enum type DeviceApiVersionEnum | ||
/// </summary> | ||
public static class DeviceApiVersionEnumHelper | ||
{ | ||
//string values corresponding the enum elements | ||
private static List<string> stringValues = new List<string> { "v3", "v2" }; | ||
|
||
/// <summary> | ||
/// Converts a DeviceApiVersionEnum value to a corresponding string value | ||
/// </summary> | ||
/// <param name="enumValue">The DeviceApiVersionEnum value to convert</param> | ||
/// <returns>The representative string value</returns> | ||
public static string ToValue(DeviceApiVersionEnum enumValue) | ||
{ | ||
switch(enumValue) | ||
{ | ||
//only valid enum elements can be used | ||
//this is necessary to avoid errors | ||
case DeviceApiVersionEnum.V3: | ||
case DeviceApiVersionEnum.V2: | ||
return stringValues[(int)enumValue]; | ||
|
||
//an invalid enum value was requested | ||
default: | ||
return null; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Convert a list of DeviceApiVersionEnum values to a list of strings | ||
/// </summary> | ||
/// <param name="enumValues">The list of DeviceApiVersionEnum values to convert</param> | ||
/// <returns>The list of representative string values</returns> | ||
public static List<string> ToValue(List<DeviceApiVersionEnum> enumValues) | ||
{ | ||
if (null == enumValues) | ||
return null; | ||
|
||
return enumValues.Select(eVal => ToValue(eVal)).ToList(); | ||
} | ||
|
||
/// <summary> | ||
/// Converts a string value into DeviceApiVersionEnum value | ||
/// </summary> | ||
/// <param name="value">The string value to parse</param> | ||
/// <returns>The parsed DeviceApiVersionEnum value</returns> | ||
public static DeviceApiVersionEnum ParseString(string value) | ||
{ | ||
int index = stringValues.IndexOf(value); | ||
if(index < 0) | ||
throw new InvalidCastException(string.Format("Unable to cast value: {0} to type DeviceApiVersionEnum", value)); | ||
|
||
return (DeviceApiVersionEnum) index; | ||
} | ||
} | ||
} |
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