Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 0b463b5

Browse files
authored
Merge pull request #77 from microsoftgraph/v1.0/pipelinebuild/100589
Generated v1.0 models and request builders using Kiota
2 parents 860568a + 17313a2 commit 0b463b5

File tree

19,947 files changed

+1554027
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

19,947 files changed

+1554027
-3
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
### Changed
13+
14+
## [0.11.0] - 2023-01-10
15+
16+
### Added
17+
18+
- Initial preview release
19+

lib/microsoft_graph/admin/admin.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module MicrosoftGraph::Admin
2+
end
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
require 'microsoft_kiota_abstractions'
2+
require_relative '../models/admin'
3+
require_relative '../models/o_data_errors/o_data_error'
4+
require_relative './admin'
5+
require_relative './service_announcement/service_announcement_request_builder'
6+
7+
module MicrosoftGraph::Admin
8+
##
9+
# Provides operations to manage the admin singleton.
10+
class AdminRequestBuilder
11+
12+
##
13+
# Path parameters for the request
14+
@path_parameters
15+
##
16+
# The request adapter to use to execute the requests.
17+
@request_adapter
18+
##
19+
# Provides operations to manage the serviceAnnouncement property of the microsoft.graph.admin entity.
20+
def service_announcement()
21+
return MicrosoftGraph::Admin::ServiceAnnouncement::ServiceAnnouncementRequestBuilder.new(@path_parameters, @request_adapter)
22+
end
23+
##
24+
# Url template to use to build the URL for the current request builder
25+
@url_template
26+
##
27+
## Instantiates a new AdminRequestBuilder and sets the default values.
28+
## @param pathParameters Path parameters for the request
29+
## @param requestAdapter The request adapter to use to execute the requests.
30+
## @return a void
31+
##
32+
def initialize(path_parameters, request_adapter)
33+
raise StandardError, 'path_parameters cannot be null' if path_parameters.nil?
34+
raise StandardError, 'request_adapter cannot be null' if request_adapter.nil?
35+
@url_template = "{+baseurl}/admin{?%24select,%24expand}"
36+
@request_adapter = request_adapter
37+
path_parameters = { "request-raw-url" => path_parameters } if path_parameters.is_a? String
38+
@path_parameters = path_parameters if path_parameters.is_a? Hash
39+
end
40+
##
41+
## Get admin
42+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
43+
## @return a Fiber of admin
44+
##
45+
def get(request_configuration=nil)
46+
request_info = self.to_get_request_information(
47+
request_configuration
48+
)
49+
error_mapping = Hash.new
50+
error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
51+
error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
52+
return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::Admin.create_from_discriminator_value(pn) }, error_mapping)
53+
end
54+
##
55+
## Update admin
56+
## @param body The request body
57+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
58+
## @return a Fiber of admin
59+
##
60+
def patch(body, request_configuration=nil)
61+
raise StandardError, 'body cannot be null' if body.nil?
62+
request_info = self.to_patch_request_information(
63+
body, request_configuration
64+
)
65+
error_mapping = Hash.new
66+
error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
67+
error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
68+
return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::Admin.create_from_discriminator_value(pn) }, error_mapping)
69+
end
70+
##
71+
## Get admin
72+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
73+
## @return a request_information
74+
##
75+
def to_get_request_information(request_configuration=nil)
76+
request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
77+
request_info.url_template = @url_template
78+
request_info.path_parameters = @path_parameters
79+
request_info.http_method = :GET
80+
request_info.headers.add('Accept', 'application/json')
81+
unless request_configuration.nil?
82+
request_info.add_headers_from_raw_object(request_configuration.headers)
83+
request_info.set_query_string_parameters_from_raw_object(request_configuration.query_parameters)
84+
request_info.add_request_options(request_configuration.options)
85+
end
86+
return request_info
87+
end
88+
##
89+
## Update admin
90+
## @param body The request body
91+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
92+
## @return a request_information
93+
##
94+
def to_patch_request_information(body, request_configuration=nil)
95+
raise StandardError, 'body cannot be null' if body.nil?
96+
request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
97+
request_info.url_template = @url_template
98+
request_info.path_parameters = @path_parameters
99+
request_info.http_method = :PATCH
100+
request_info.headers.add('Accept', 'application/json')
101+
unless request_configuration.nil?
102+
request_info.add_headers_from_raw_object(request_configuration.headers)
103+
request_info.add_request_options(request_configuration.options)
104+
end
105+
request_info.set_content_from_parsable(self.request_adapter, "application/json", body)
106+
return request_info
107+
end
108+
109+
##
110+
# Get admin
111+
class AdminRequestBuilderGetQueryParameters
112+
113+
##
114+
# Expand related entities
115+
attr_accessor :expand
116+
##
117+
# Select properties to be returned
118+
attr_accessor :select
119+
##
120+
## Maps the query parameters names to their encoded names for the URI template parsing.
121+
## @param originalName The original query parameter name in the class.
122+
## @return a string
123+
##
124+
def get_query_parameter(original_name)
125+
raise StandardError, 'original_name cannot be null' if original_name.nil?
126+
case original_name
127+
when "expand"
128+
return "%24expand"
129+
when "select"
130+
return "%24select"
131+
else
132+
return original_name
133+
end
134+
end
135+
end
136+
137+
##
138+
# Configuration for the request such as headers, query parameters, and middleware options.
139+
class AdminRequestBuilderGetRequestConfiguration
140+
141+
##
142+
# Request headers
143+
attr_accessor :headers
144+
##
145+
# Request options
146+
attr_accessor :options
147+
##
148+
# Request query parameters
149+
attr_accessor :query_parameters
150+
end
151+
152+
##
153+
# Configuration for the request such as headers, query parameters, and middleware options.
154+
class AdminRequestBuilderPatchRequestConfiguration
155+
156+
##
157+
# Request headers
158+
attr_accessor :headers
159+
##
160+
# Request options
161+
attr_accessor :options
162+
end
163+
end
164+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module MicrosoftGraph::Admin::ServiceAnnouncement::HealthOverviews::Count
2+
end
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
require 'microsoft_kiota_abstractions'
2+
require_relative '../../../../models/o_data_errors/o_data_error'
3+
require_relative '../../../admin'
4+
require_relative '../../service_announcement'
5+
require_relative '../health_overviews'
6+
require_relative './count'
7+
8+
module MicrosoftGraph::Admin::ServiceAnnouncement::HealthOverviews::Count
9+
##
10+
# Provides operations to count the resources in the collection.
11+
class CountRequestBuilder
12+
13+
##
14+
# Path parameters for the request
15+
@path_parameters
16+
##
17+
# The request adapter to use to execute the requests.
18+
@request_adapter
19+
##
20+
# Url template to use to build the URL for the current request builder
21+
@url_template
22+
##
23+
## Instantiates a new CountRequestBuilder and sets the default values.
24+
## @param pathParameters Path parameters for the request
25+
## @param requestAdapter The request adapter to use to execute the requests.
26+
## @return a void
27+
##
28+
def initialize(path_parameters, request_adapter)
29+
raise StandardError, 'path_parameters cannot be null' if path_parameters.nil?
30+
raise StandardError, 'request_adapter cannot be null' if request_adapter.nil?
31+
@url_template = "{+baseurl}/admin/serviceAnnouncement/healthOverviews/$count"
32+
@request_adapter = request_adapter
33+
path_parameters = { "request-raw-url" => path_parameters } if path_parameters.is_a? String
34+
@path_parameters = path_parameters if path_parameters.is_a? Hash
35+
end
36+
##
37+
## Get the number of the resource
38+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
39+
## @return a Fiber of integer
40+
##
41+
def get(request_configuration=nil)
42+
request_info = self.to_get_request_information(
43+
request_configuration
44+
)
45+
error_mapping = Hash.new
46+
error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
47+
error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrors::ODataError.create_from_discriminator_value(pn) }
48+
return @request_adapter.send_async(request_info, number, error_mapping)
49+
end
50+
##
51+
## Get the number of the resource
52+
## @param requestConfiguration Configuration for the request such as headers, query parameters, and middleware options.
53+
## @return a request_information
54+
##
55+
def to_get_request_information(request_configuration=nil)
56+
request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
57+
request_info.url_template = @url_template
58+
request_info.path_parameters = @path_parameters
59+
request_info.http_method = :GET
60+
request_info.headers.add('Accept', 'text/plain')
61+
unless request_configuration.nil?
62+
request_info.add_headers_from_raw_object(request_configuration.headers)
63+
request_info.add_request_options(request_configuration.options)
64+
end
65+
return request_info
66+
end
67+
68+
##
69+
# Configuration for the request such as headers, query parameters, and middleware options.
70+
class CountRequestBuilderGetRequestConfiguration
71+
72+
##
73+
# Request headers
74+
attr_accessor :headers
75+
##
76+
# Request options
77+
attr_accessor :options
78+
end
79+
end
80+
end
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module MicrosoftGraph::Admin::ServiceAnnouncement::HealthOverviews
2+
end

0 commit comments

Comments
 (0)