microsoft_kiota_abstractions 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/dependabot.yml +12 -0
- data/.github/workflows/code-ql.yml +76 -0
- data/.github/workflows/conflicting-pr-label.yml +34 -0
- data/.github/workflows/projectsbot.yml +81 -0
- data/.github/workflows/release.yml +45 -0
- data/.github/workflows/ruby.yml +34 -0
- data/.gitignore +58 -0
- data/CHANGELOG.md +18 -0
- data/CODE_OF_CONDUCT.md +9 -0
- data/Gemfile +6 -0
- data/LICENSE +21 -0
- data/README.md +51 -0
- data/Rakefile +8 -0
- data/SECURITY.md +41 -0
- data/SUPPORT.md +25 -0
- data/lib/microsoft_kiota_abstractions/api_client_builder.rb +19 -0
- data/lib/microsoft_kiota_abstractions/api_error.rb +23 -0
- data/lib/microsoft_kiota_abstractions/authentication/access_token_provider.rb +20 -0
- data/lib/microsoft_kiota_abstractions/authentication/allowed_hosts_validator.rb +39 -0
- data/lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb +7 -0
- data/lib/microsoft_kiota_abstractions/authentication/authentication_provider.rb +7 -0
- data/lib/microsoft_kiota_abstractions/authentication/base_bearer_token_authentication_provider.rb +26 -0
- data/lib/microsoft_kiota_abstractions/http_method.rb +17 -0
- data/lib/microsoft_kiota_abstractions/request_adapter.rb +25 -0
- data/lib/microsoft_kiota_abstractions/request_headers.rb +44 -0
- data/lib/microsoft_kiota_abstractions/request_information.rb +130 -0
- data/lib/microsoft_kiota_abstractions/request_option.rb +7 -0
- data/lib/microsoft_kiota_abstractions/serialization/additional_data_holder.rb +7 -0
- data/lib/microsoft_kiota_abstractions/serialization/iso_duration.rb +209 -0
- data/lib/microsoft_kiota_abstractions/serialization/parsable.rb +11 -0
- data/lib/microsoft_kiota_abstractions/serialization/parse_node.rb +61 -0
- data/lib/microsoft_kiota_abstractions/serialization/parse_node_factory.rb +7 -0
- data/lib/microsoft_kiota_abstractions/serialization/parse_node_factory_registry.rb +42 -0
- data/lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb +69 -0
- data/lib/microsoft_kiota_abstractions/serialization/serialization_writer_factory.rb +9 -0
- data/lib/microsoft_kiota_abstractions/serialization/serialization_writer_factory_registry.rb +40 -0
- data/lib/microsoft_kiota_abstractions/version.rb +5 -0
- data/lib/microsoft_kiota_abstractions.rb +25 -0
- data/microsoft_kiota_abstractions.gemspec +36 -0
- metadata +165 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require_relative 'serialization_writer_factory'
|
2
|
+
|
3
|
+
module MicrosoftKiotaAbstractions
|
4
|
+
class SerializationWriterFactoryRegistry
|
5
|
+
include SerializationWriterFactory
|
6
|
+
|
7
|
+
class << self
|
8
|
+
attr_accessor :default_instance
|
9
|
+
def default_instance; @default_instance ||= SerializationWriterFactoryRegistry.new; end
|
10
|
+
end
|
11
|
+
|
12
|
+
def default_instance
|
13
|
+
self.class.default_instance
|
14
|
+
end
|
15
|
+
|
16
|
+
def content_type_associated_factories
|
17
|
+
@content_type_associated_factories ||= Hash.new
|
18
|
+
end
|
19
|
+
|
20
|
+
def get_serialization_writer(content_type)
|
21
|
+
if !content_type
|
22
|
+
raise Exception.new 'content type cannot be undefined or empty'
|
23
|
+
end
|
24
|
+
vendor_specific_content_type = content_type.split(';').first
|
25
|
+
factory = @content_type_associated_factories[vendor_specific_content_type]
|
26
|
+
if factory
|
27
|
+
return factory.get_serialization_writer(vendor_specific_content_type)
|
28
|
+
end
|
29
|
+
|
30
|
+
clean_content_type = vendor_specific_content_type.gsub(/[^\/]+\+/i, '')
|
31
|
+
factory = @content_type_associated_factories[clean_content_type]
|
32
|
+
if factory
|
33
|
+
return factory.get_serialization_writer(clean_content_type)
|
34
|
+
end
|
35
|
+
|
36
|
+
raise Exception.new "Content type #{contentType} does not have a factory to be serialized"
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "microsoft_kiota_abstractions/authentication/authentication_provider"
|
4
|
+
require_relative "microsoft_kiota_abstractions/authentication/base_bearer_token_authentication_provider"
|
5
|
+
require_relative "microsoft_kiota_abstractions/authentication/anonymous_authentication_provider"
|
6
|
+
require_relative "microsoft_kiota_abstractions/api_error"
|
7
|
+
require_relative "microsoft_kiota_abstractions/http_method"
|
8
|
+
require_relative "microsoft_kiota_abstractions/api_client_builder"
|
9
|
+
require_relative "microsoft_kiota_abstractions/request_adapter"
|
10
|
+
require_relative "microsoft_kiota_abstractions/request_option"
|
11
|
+
require_relative "microsoft_kiota_abstractions/request_headers"
|
12
|
+
require_relative "microsoft_kiota_abstractions/request_information"
|
13
|
+
require_relative "microsoft_kiota_abstractions/version"
|
14
|
+
require_relative "microsoft_kiota_abstractions/serialization/parsable"
|
15
|
+
require_relative "microsoft_kiota_abstractions/serialization/iso_duration"
|
16
|
+
require_relative "microsoft_kiota_abstractions/serialization/additional_data_holder"
|
17
|
+
require_relative "microsoft_kiota_abstractions/serialization/parse_node"
|
18
|
+
require_relative "microsoft_kiota_abstractions/serialization/parse_node_factory"
|
19
|
+
require_relative "microsoft_kiota_abstractions/serialization/parse_node_factory_registry"
|
20
|
+
require_relative "microsoft_kiota_abstractions/serialization/serialization_writer"
|
21
|
+
require_relative "microsoft_kiota_abstractions/serialization/serialization_writer_factory"
|
22
|
+
require_relative "microsoft_kiota_abstractions/serialization/serialization_writer_factory_registry"
|
23
|
+
|
24
|
+
module MicrosoftKiotaAbstractions
|
25
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'lib/microsoft_kiota_abstractions/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'microsoft_kiota_abstractions'
|
7
|
+
spec.version = MicrosoftKiotaAbstractions::VERSION
|
8
|
+
spec.authors = 'Microsoft Corporation'
|
9
|
+
spec.email = 'graphsdkpub@microsoft.com'
|
10
|
+
spec.description = 'Microsoft Kiota Abstractions - Ruby abstractions for building library agnostic http client'
|
11
|
+
spec.summary = 'The Kiota abstractions are language specific libraries defining the basic constructs Kiota projects need once an SDK has been generated from an OpenAPI definition.'
|
12
|
+
spec.homepage = 'https://microsoft.github.io/kiota/'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
spec.metadata = {
|
15
|
+
'bug_tracker_uri' => 'https://github.com/microsoft/kiota-abstractions-ruby/issues',
|
16
|
+
'changelog_uri' => 'https://github.com/microsoft/kiota-abstractions-ruby/blob/main/CHANGELOG.md',
|
17
|
+
'homepage_uri' => spec.homepage,
|
18
|
+
'source_code_uri' => 'https://github.com/microsoft/kiota-abstractions-ruby',
|
19
|
+
'github_repo' => 'ssh://github.com/microsoft/kiota-abstractions-ruby'
|
20
|
+
}
|
21
|
+
spec.required_ruby_version = '>= 2.7.0'
|
22
|
+
|
23
|
+
# Specify which files should be added to the gem when it is released.
|
24
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
25
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
26
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
27
|
+
end
|
28
|
+
spec.bindir = 'bin'
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
spec.add_runtime_dependency 'addressable', '~> 2.7', '>= 2.7.0'
|
32
|
+
spec.add_runtime_dependency 'iso8601', '~> 0.13.0'
|
33
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
34
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
35
|
+
spec.add_development_dependency 'rubocop'
|
36
|
+
end
|
metadata
ADDED
@@ -0,0 +1,165 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: microsoft_kiota_abstractions
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.12.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Microsoft Corporation
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-12-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: addressable
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.7'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 2.7.0
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '2.7'
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.7.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: iso8601
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 0.13.0
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.13.0
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rake
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - "~>"
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '13.0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '13.0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: rspec
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '3.0'
|
68
|
+
type: :development
|
69
|
+
prerelease: false
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rubocop
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: '0'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
description: Microsoft Kiota Abstractions - Ruby abstractions for building library
|
90
|
+
agnostic http client
|
91
|
+
email: graphsdkpub@microsoft.com
|
92
|
+
executables: []
|
93
|
+
extensions: []
|
94
|
+
extra_rdoc_files: []
|
95
|
+
files:
|
96
|
+
- ".github/CODEOWNERS"
|
97
|
+
- ".github/dependabot.yml"
|
98
|
+
- ".github/workflows/code-ql.yml"
|
99
|
+
- ".github/workflows/conflicting-pr-label.yml"
|
100
|
+
- ".github/workflows/projectsbot.yml"
|
101
|
+
- ".github/workflows/release.yml"
|
102
|
+
- ".github/workflows/ruby.yml"
|
103
|
+
- ".gitignore"
|
104
|
+
- CHANGELOG.md
|
105
|
+
- CODE_OF_CONDUCT.md
|
106
|
+
- Gemfile
|
107
|
+
- LICENSE
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- SECURITY.md
|
111
|
+
- SUPPORT.md
|
112
|
+
- lib/microsoft_kiota_abstractions.rb
|
113
|
+
- lib/microsoft_kiota_abstractions/api_client_builder.rb
|
114
|
+
- lib/microsoft_kiota_abstractions/api_error.rb
|
115
|
+
- lib/microsoft_kiota_abstractions/authentication/access_token_provider.rb
|
116
|
+
- lib/microsoft_kiota_abstractions/authentication/allowed_hosts_validator.rb
|
117
|
+
- lib/microsoft_kiota_abstractions/authentication/anonymous_authentication_provider.rb
|
118
|
+
- lib/microsoft_kiota_abstractions/authentication/authentication_provider.rb
|
119
|
+
- lib/microsoft_kiota_abstractions/authentication/base_bearer_token_authentication_provider.rb
|
120
|
+
- lib/microsoft_kiota_abstractions/http_method.rb
|
121
|
+
- lib/microsoft_kiota_abstractions/request_adapter.rb
|
122
|
+
- lib/microsoft_kiota_abstractions/request_headers.rb
|
123
|
+
- lib/microsoft_kiota_abstractions/request_information.rb
|
124
|
+
- lib/microsoft_kiota_abstractions/request_option.rb
|
125
|
+
- lib/microsoft_kiota_abstractions/serialization/additional_data_holder.rb
|
126
|
+
- lib/microsoft_kiota_abstractions/serialization/iso_duration.rb
|
127
|
+
- lib/microsoft_kiota_abstractions/serialization/parsable.rb
|
128
|
+
- lib/microsoft_kiota_abstractions/serialization/parse_node.rb
|
129
|
+
- lib/microsoft_kiota_abstractions/serialization/parse_node_factory.rb
|
130
|
+
- lib/microsoft_kiota_abstractions/serialization/parse_node_factory_registry.rb
|
131
|
+
- lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb
|
132
|
+
- lib/microsoft_kiota_abstractions/serialization/serialization_writer_factory.rb
|
133
|
+
- lib/microsoft_kiota_abstractions/serialization/serialization_writer_factory_registry.rb
|
134
|
+
- lib/microsoft_kiota_abstractions/version.rb
|
135
|
+
- microsoft_kiota_abstractions.gemspec
|
136
|
+
homepage: https://microsoft.github.io/kiota/
|
137
|
+
licenses:
|
138
|
+
- MIT
|
139
|
+
metadata:
|
140
|
+
bug_tracker_uri: https://github.com/microsoft/kiota-abstractions-ruby/issues
|
141
|
+
changelog_uri: https://github.com/microsoft/kiota-abstractions-ruby/blob/main/CHANGELOG.md
|
142
|
+
homepage_uri: https://microsoft.github.io/kiota/
|
143
|
+
source_code_uri: https://github.com/microsoft/kiota-abstractions-ruby
|
144
|
+
github_repo: ssh://github.com/microsoft/kiota-abstractions-ruby
|
145
|
+
post_install_message:
|
146
|
+
rdoc_options: []
|
147
|
+
require_paths:
|
148
|
+
- lib
|
149
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
version: 2.7.0
|
154
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
requirements: []
|
160
|
+
rubygems_version: 3.3.26
|
161
|
+
signing_key:
|
162
|
+
specification_version: 4
|
163
|
+
summary: The Kiota abstractions are language specific libraries defining the basic
|
164
|
+
constructs Kiota projects need once an SDK has been generated from an OpenAPI definition.
|
165
|
+
test_files: []
|