microsoft_kiota_abstractions 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/microsoft_kiota_abstractions/request_adapter.rb +15 -1
- data/lib/microsoft_kiota_abstractions/request_information.rb +28 -0
- data/lib/microsoft_kiota_abstractions/serialization/parse_node.rb +4 -0
- data/lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb +4 -0
- data/lib/microsoft_kiota_abstractions/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5b0d519d17b9e2040671a52e59532ed171932e991635205ca010efb4c388878
|
|
4
|
+
data.tar.gz: 7941e0f36cc34db4600f1dcf13576240217e80407040388b459ea07ebd4ab258
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fbe61979cac718aa7bf7fa9f834bd98ad425fe50098b66a4321158d70db13aa62f2c3714034215671bc566abe80fc46c53b72b88ac3a96ea25f6120daba9d8d4
|
|
7
|
+
data.tar.gz: 33dc867288c8dbb98277fc0b2ab1e0d484510047e0db542dac28dd6456a39d5ee01c2e787b1ba061f66a2a0bc4cf59d6cb1cf5180d077f8d5c51767bc4553536
|
|
@@ -8,7 +8,21 @@ module MicrosoftKiotaAbstractions
|
|
|
8
8
|
raise NotImplementedError
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
def send_collection_async(_request_info, _factory, _errors_mapping)
|
|
12
|
+
raise NotImplementedError
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def send_collection_of_primitive_async(_request_info, _type, _errors_mapping)
|
|
16
|
+
raise NotImplementedError
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def send_primitive_async(_request_info, _type, _errors_mapping)
|
|
20
|
+
raise NotImplementedError
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def send_no_response_content_async(_request_info, _errors_mapping)
|
|
24
|
+
raise NotImplementedError
|
|
25
|
+
end
|
|
12
26
|
|
|
13
27
|
def get_serialization_writer_factory
|
|
14
28
|
raise NotImplementedError
|
|
@@ -81,6 +81,34 @@ module MicrosoftKiotaAbstractions
|
|
|
81
81
|
@headers.try_add(@@content_type_header, content_type)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
SCALAR_WRITERS = {
|
|
85
|
+
'String' => :write_string_value,
|
|
86
|
+
'Integer' => :write_number_value,
|
|
87
|
+
'Float' => :write_float_value,
|
|
88
|
+
'TrueClass' => :write_boolean_value,
|
|
89
|
+
'FalseClass' => :write_boolean_value,
|
|
90
|
+
'Date' => :write_date_value,
|
|
91
|
+
'DateTime' => :write_date_time_value,
|
|
92
|
+
'Time' => :write_time_value,
|
|
93
|
+
'MicrosoftKiotaAbstractions::ISODuration' => :write_duration_value,
|
|
94
|
+
'UUIDTools::UUID' => :write_guid_value,
|
|
95
|
+
'Symbol' => :write_enum_value
|
|
96
|
+
}.freeze
|
|
97
|
+
|
|
98
|
+
def set_content_from_scalar(request_adapter, content_type, values)
|
|
99
|
+
writer = request_adapter.get_serialization_writer_factory.get_serialization_writer(content_type)
|
|
100
|
+
@headers.try_add(@@content_type_header, content_type)
|
|
101
|
+
if values.is_a?(Array)
|
|
102
|
+
writer.write_collection_of_primitive_values(nil, values)
|
|
103
|
+
else
|
|
104
|
+
method = SCALAR_WRITERS[values.class.to_s]
|
|
105
|
+
raise StandardError, "unknown type during serialization: #{values.class}" if method.nil?
|
|
106
|
+
|
|
107
|
+
writer.public_send(method, nil, values)
|
|
108
|
+
end
|
|
109
|
+
@content = writer.get_serialized_content
|
|
110
|
+
end
|
|
111
|
+
|
|
84
112
|
def set_content_from_parsable(request_adapter, content_type, values)
|
|
85
113
|
writer = request_adapter.get_serialization_writer_factory.get_serialization_writer(content_type)
|
|
86
114
|
@headers.try_add(@@content_type_header, content_type)
|