-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add helper libs semantic types configuration (#77)
- Loading branch information
childish-sambino
authored
Oct 4, 2022
1 parent
bfcd919
commit 58823d4
Showing
7 changed files
with
495 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
{ | ||
"library": { | ||
"_": null, | ||
"date": ["System", "Twilio.Converters"], | ||
"date_time": ["System", "Twilio.Converters"], | ||
"date_or_time": ["System", "Twilio.Converters"], | ||
"date_time_inequality": ["System", "Twilio.Converters"], | ||
"date_time_range": ["System", "Twilio.Converters"], | ||
"decimal": "System", | ||
"url": ["System", "Twilio.Converters"], | ||
"uri_map": "System.Collections.Generic", | ||
"string_map": "System.Collections.Generic", | ||
"endpoint": "Twilio.Types", | ||
"twiml": "Twilio.Types", | ||
"ice_server": "Twilio.Types", | ||
"subscribe_rule": "Twilio.Types", | ||
"recording_rule": "Twilio.Types", | ||
"phone_number_capabilities": "Twilio.Types", | ||
"feedback_issue": "Twilio.Types", | ||
"object": ["System", "Twilio.Converters"], | ||
"phone_number_price": "Twilio.Types", | ||
"outbound_sms_price": "Twilio.Types", | ||
"inbound_sms_price": "Twilio.Types", | ||
"outbound_prefix_price": "Twilio.Types", | ||
"outbound_prefix_price_with_origin": "Twilio.Types", | ||
"inbound_call_price": "Twilio.Types", | ||
"outbound_call_price": "Twilio.Types", | ||
"outbound_call_price_with_origin": "Twilio.Types", | ||
"prefixed_collapsible_map": [ | ||
"Twilio.Converters", | ||
"System.Collections.Generic" | ||
] | ||
}, | ||
|
||
"properties": { | ||
"_": "string", | ||
"boolean": "bool?", | ||
"currency": "string", | ||
"date": "DateTime?", | ||
"date_time": "DateTime?", | ||
"date_or_time": "DateTime?", | ||
"date_time_range": "Range<DateTime>", | ||
"decimal": "decimal?", | ||
"endpoint": "IEndpoint", | ||
"http_method": "Twilio.Http.HttpMethod", | ||
"integer": "int?", | ||
"long": "long?", | ||
"url": "Uri", | ||
"uri_map": "Dictionary<string, string>", | ||
"string_map": "Dictionary<string, string>", | ||
"phone_number": "Types.PhoneNumber", | ||
"twiml": "Types.Twiml", | ||
"ice_server": "IceServer", | ||
"subscribe_rule": "SubscribeRule", | ||
"recording_rule": "RecordingRule", | ||
"phone_number_capabilities": "PhoneNumberCapabilities", | ||
"feedback_issue": "FeedbackIssue", | ||
"object": "object", | ||
"phone_number_price": "PhoneNumberPrice", | ||
"outbound_sms_price": "OutboundSmsPrice", | ||
"inbound_sms_price": "InboundSmsPrice", | ||
"outbound_prefix_price": "OutboundPrefixPrice", | ||
"outbound_prefix_price_with_origin": "OutboundPrefixPriceWithOrigin", | ||
"inbound_call_price": "InboundCallPrice", | ||
"outbound_call_price": "OutboundCallPrice", | ||
"outbound_call_price_with_origin": "OutboundCallPriceWithOrigin", | ||
"prefixed_collapsible_map": "Dictionary<string, object>" | ||
}, | ||
|
||
"json": { | ||
"_": "string", | ||
"date_time": "string", | ||
"date": "string" | ||
}, | ||
|
||
"hydrate": { | ||
"_": "{value}", | ||
"date_or_time": "MarshalConverter.DateTimeFromString({value})", | ||
"date_time": "MarshalConverter.DateTimeFromString({value})", | ||
"date": "MarshalConverter.DateTimeFromString({value})" | ||
}, | ||
|
||
"promotions": { | ||
"url": { | ||
"string": "Promoter.UriFromString({})" | ||
} | ||
}, | ||
|
||
"deserialize": { | ||
"enum": "StringEnumConverter", | ||
"ienum": "StringEnumConverter", | ||
"http_method": "HttpMethodConverter", | ||
"phone_number": "PhoneNumberConverter", | ||
"twiml": "TwimlConverter" | ||
}, | ||
|
||
"serialize": { | ||
"_": "{value}.ToString()", | ||
"url": "Serializers.Url({value})", | ||
"string": "{value}", | ||
"object": "Serializers.JsonObject({value})", | ||
"boolean": "{value}.Value.ToString().ToLower()", | ||
"decimal": "{value}.Value.ToString()", | ||
"integer": "{value}.ToString()", | ||
"long": "{value}.Value.ToString()", | ||
"date_time_inequality": "Serializers.DateTimeIso8601({value})", | ||
"date_inequality": "{value}.Value.ToString(\"yyyy-MM-dd\")", | ||
"date_or_time": "Serializers.DateTimeIso8601({value})", | ||
"date_time": "Serializers.DateTimeIso8601({value})", | ||
"date": "{value}.Value.ToString(\"yyyy-MM-dd\")", | ||
"prefixed_collapsible_map": "PrefixedCollapsibleMap.Serialize({value}, {trait})" | ||
}, | ||
|
||
"cardinality": { | ||
"_": "single", | ||
"prefixed_collapsible_map": "multi" | ||
} | ||
} |
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,21 @@ | ||
{ | ||
"library": { | ||
"_": null | ||
}, | ||
|
||
"properties": { | ||
"_": "" | ||
}, | ||
|
||
"json": { | ||
"_": "" | ||
}, | ||
|
||
"hydrate": { | ||
"_": "{}" | ||
}, | ||
|
||
"promotions": { | ||
|
||
} | ||
} |
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,126 @@ | ||
{ | ||
"library": { | ||
"_": null, | ||
"currency": "java.util.Currency", | ||
"date": [ | ||
"java.time.LocalDate", | ||
"com.twilio.converter.DateConverter" | ||
], | ||
"date_time": [ | ||
"java.time.ZonedDateTime", | ||
"com.twilio.converter.DateConverter" | ||
], | ||
"date_or_time": [ | ||
"java.time.ZonedDateTime", | ||
"com.twilio.converter.DateConverter" | ||
], | ||
"date_time_range": [ | ||
"java.time.ZonedDateTime", | ||
"com.twilio.converter.DateConverter" | ||
], | ||
"decimal": "java.math.BigDecimal", | ||
"endpoint": "com.twilio.type.Endpoint", | ||
"http_method": "com.twilio.http.HttpMethod", | ||
"url": "java.net.URI", | ||
"ice_server": "com.twilio.type.IceServer", | ||
"subscribe_rule": "com.twilio.type.SubscribeRule", | ||
"recording_rule": "com.twilio.type.RecordingRule", | ||
"phone_number_capabilities": "com.twilio.type.PhoneNumberCapabilities", | ||
"feedback_issue": "com.twilio.type.FeedbackIssue", | ||
"object": ["java.util.Map", "com.twilio.converter.Converter"], | ||
"phone_number_price": "com.twilio.type.PhoneNumberPrice", | ||
"outbound_sms_price": "com.twilio.type.OutboundSmsPrice", | ||
"inbound_sms_price": "com.twilio.type.InboundSmsPrice", | ||
"outbound_prefix_price": "com.twilio.type.OutboundPrefixPrice", | ||
"inbound_call_price": "com.twilio.type.InboundCallPrice", | ||
"outbound_call_price": "com.twilio.type.OutboundCallPrice", | ||
"outbound_call_price_with_origin": "com.twilio.type.OutboundCallPriceWithOrigin", | ||
"outbound_prefix_price_with_origin": "com.twilio.type.OutboundPrefixPriceWithOrigin", | ||
"prefixed_collapsible_map": ["com.twilio.converter.PrefixedCollapsibleMap", "java.util.Map"], | ||
"twiml": "com.twilio.type.Twiml" | ||
}, | ||
|
||
"properties": { | ||
"_": "String", | ||
"boolean": "Boolean", | ||
"currency": "Currency", | ||
"date": "LocalDate", | ||
"date_range": "LocalDate", | ||
"date_time": "ZonedDateTime", | ||
"date_or_time": "ZonedDateTime", | ||
"date_time_range": "ZonedDateTime", | ||
"decimal": "BigDecimal", | ||
"endpoint": "com.twilio.type.Endpoint", | ||
"feedback_issue": "FeedbackIssue", | ||
"http_method": "HttpMethod", | ||
"ice_server": "IceServer", | ||
"subscribe_rule": "SubscribeRule", | ||
"recording_rule": "RecordingRule", | ||
"inbound_call_price": "InboundCallPrice", | ||
"inbound_sms_price": "InboundSmsPrice", | ||
"integer": "Integer", | ||
"long": "Long", | ||
"object": "Map<String, Object>", | ||
"outbound_call_price": "OutboundCallPrice", | ||
"outbound_call_price_with_origin": "OutboundCallPriceWithOrigin", | ||
"outbound_prefix_price": "OutboundPrefixPrice", | ||
"outbound_sms_price": "OutboundSmsPrice", | ||
"phone_number": "com.twilio.type.PhoneNumber", | ||
"phone_number_capabilities": "PhoneNumberCapabilities", | ||
"phone_number_price": "PhoneNumberPrice", | ||
"prefixed_collapsible_map": "Map<String, Object>", | ||
"outbound_prefix_price_with_origin": "OutboundPrefixPriceWithOrigin", | ||
"string_map": "Map<String, String>", | ||
"twiml": "com.twilio.type.Twiml", | ||
"uri_map": "Map<String, String>", | ||
"url": "URI" | ||
}, | ||
|
||
"json": { | ||
"_": "String", | ||
"date_time": "String", | ||
"date": "String" | ||
}, | ||
|
||
"hydrate": { | ||
"_": "{value}", | ||
"date_time<rfc2822>": "DateConverter.rfc2822DateTimeFromString({value})", | ||
"date_time<iso8601>": "DateConverter.iso8601DateTimeFromString({value})", | ||
"date": "DateConverter.localDateFromString({value})" | ||
}, | ||
|
||
"promotions": { | ||
"url": { | ||
"string": "Promoter.uriFromString({})" | ||
}, | ||
"phone_number": { | ||
"string": "Promoter.phoneNumberFromString({})" | ||
}, | ||
"twiml": { | ||
"string": "Promoter.twimlFromString({})" | ||
} | ||
}, | ||
|
||
"serialize": { | ||
"_": "{value}.toString()", | ||
"endpoint": "{value}.getEndpoint()", | ||
"iso_country_code": "{value}", | ||
"object": "Converter.mapToJson({value})", | ||
"date": "DateConverter.dateStringFromLocalDate({value})", | ||
"date_time": "{value}.toInstant().toString()", | ||
"date_or_time": "{value}.toInstant().toString()", | ||
"string": "{value}", | ||
"sid": "{value}", | ||
"prefixed_collapsible_map": "PrefixedCollapsibleMap.serialize({value}, {trait})" | ||
}, | ||
|
||
"deserialize": { | ||
"currency": "com.twilio.converter.CurrencyDeserializer" | ||
}, | ||
|
||
"cardinality": { | ||
"_": "single", | ||
"prefixed_collapsible_map": "multi" | ||
} | ||
|
||
} |
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,56 @@ | ||
{ | ||
"library": { | ||
"phone_number_capabilities": { | ||
"PhoneNumberCapabilities": "lib/interfaces" | ||
} | ||
}, | ||
|
||
"properties": { | ||
"_": "string", | ||
"date": "Date", | ||
"date_inequality": "Date", | ||
"date_time": "Date", | ||
"date_or_time": "Date", | ||
"date_time_inequality": "Date", | ||
"decimal": "number", | ||
"boolean": "boolean", | ||
"integer": "number", | ||
"long": "number", | ||
"object": "object", | ||
"phone_number_capabilities": "PhoneNumberCapabilities", | ||
"prefixed_collapsible_map": "object", | ||
"string_map": "object" | ||
}, | ||
|
||
"serialize": { | ||
"_": "{value}", | ||
"boolean": "serialize.bool({value})", | ||
"object": "serialize.object({value})", | ||
"date": "serialize.iso8601Date({value})", | ||
"date_inequality": "serialize.iso8601Date({value})", | ||
"date_time": "serialize.iso8601DateTime({value})", | ||
"date_or_time": "serialize.iso8601DateTime({value})", | ||
"date_time_inequality": "serialize.iso8601DateTime({value})", | ||
"prefixed_collapsible_map": "serialize.prefixedCollapsibleMap({value}, {trait})" | ||
}, | ||
|
||
"deserialize": { | ||
"_": "{value}", | ||
"date<iso8601>": "deserialize.iso8601Date({value})", | ||
"date_time<iso8601>": "deserialize.iso8601DateTime({value})", | ||
"date_time_inequality<iso8601>": "deserialize.iso8601DateTime({value})", | ||
"date_time<rfc2822>": "deserialize.rfc2822DateTime({value})", | ||
"date_time_inequality<rfc2822>": "deserialize.rfc2822DateTime({value})", | ||
"decimal": "deserialize.decimal({value})", | ||
"integer": "deserialize.integer({value})", | ||
"long": "deserialize.integer({value})" | ||
}, | ||
|
||
"cardinality": { | ||
"_": "single", | ||
"prefixed_collapsible_map": "multi" | ||
}, | ||
|
||
"promotions": { | ||
} | ||
} |
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,43 @@ | ||
{ | ||
"library": { | ||
|
||
}, | ||
|
||
"properties": { | ||
"_": "string", | ||
"date_or_time": "\\DateTime", | ||
"date_time": "\\DateTime", | ||
"date": "\\DateTime", | ||
"string_map": "array", | ||
"uri_map": "array", | ||
"object": "array", | ||
"boolean": "bool", | ||
"integer": "int" | ||
}, | ||
|
||
"serialize": { | ||
"_": "{value}", | ||
"object": "Serialize::jsonObject({value})", | ||
"prefixed_collapsible_map": "Serialize::prefixedCollapsibleMap({value}, {trait})", | ||
"date<iso8601>": "Serialize::iso8601Date({value})", | ||
"date_inequality<iso8601>": "Serialize::iso8601Date({value})", | ||
"date_time<iso8601>": "Serialize::iso8601DateTime({value})", | ||
"date_or_time<iso8601>": "Serialize::iso8601DateTime({value})", | ||
"date_time_inequality<iso8601>": "Serialize::iso8601DateTime({value})", | ||
"boolean": "Serialize::booleanToString({value})" | ||
}, | ||
|
||
"deserialize": { | ||
"_": "{value}", | ||
"date_time": "Deserialize::dateTime({value})", | ||
"date_or_time": "Deserialize::dateTime({value})", | ||
"date_time_inequality": "Deserialize::dateTime({value})", | ||
"date": "Deserialize::dateTime({value})", | ||
"date_inequality": "Deserialize::dateTime({value})" | ||
}, | ||
|
||
"cardinality": { | ||
"_": "single", | ||
"prefixed_collapsible_map": "multi" | ||
} | ||
} |
Oops, something went wrong.