Class: MicrosoftGraph::Devices::Item::DeviceItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/devices/item/device_item_request_builder.rb

Overview

Provides operations to manage the collection of device entities.

Defined Under Namespace

Classes: DeviceItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new DeviceItemRequestBuilder and sets the default values.

Parameters:

  • Path parameters for the request

  • The request adapter to use to execute the requests.



81
82
83
# File 'lib/devices/item/device_item_request_builder.rb', line 81

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/devices/{device%2Did}{?%24select,%24expand}")
end

Instance Method Details

#check_member_groupsObject

Provides operations to call the checkMemberGroups method.



27
28
29
# File 'lib/devices/item/device_item_request_builder.rb', line 27

def check_member_groups()
    return MicrosoftGraph::Devices::Item::CheckMemberGroups::CheckMemberGroupsRequestBuilder.new(@path_parameters, @request_adapter)
end

#check_member_objectsObject

Provides operations to call the checkMemberObjects method.



32
33
34
# File 'lib/devices/item/device_item_request_builder.rb', line 32

def check_member_objects()
    return MicrosoftGraph::Devices::Item::CheckMemberObjects::CheckMemberObjectsRequestBuilder.new(@path_parameters, @request_adapter)
end

#delete(request_configuration = nil) ⇒ Object

Delete a registered device.

Parameters:

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of void



89
90
91
92
93
94
95
96
97
# File 'lib/devices/item/device_item_request_builder.rb', line 89

def delete(request_configuration=nil)
    request_info = self.to_delete_request_information(
        request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, nil, error_mapping)
end

#extensionsObject

Provides operations to manage the extensions property of the microsoft.graph.device entity.



37
38
39
# File 'lib/devices/item/device_item_request_builder.rb', line 37

def extensions()
    return MicrosoftGraph::Devices::Item::Extensions::ExtensionsRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

Get the properties and relationships of a device object.

Parameters:

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of device



103
104
105
106
107
108
109
110
111
# File 'lib/devices/item/device_item_request_builder.rb', line 103

def get(request_configuration=nil)
    request_info = self.to_get_request_information(
        request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::Device.create_from_discriminator_value(pn) }, error_mapping)
end

#get_member_groupsObject

Provides operations to call the getMemberGroups method.



42
43
44
# File 'lib/devices/item/device_item_request_builder.rb', line 42

def get_member_groups()
    return MicrosoftGraph::Devices::Item::GetMemberGroups::GetMemberGroupsRequestBuilder.new(@path_parameters, @request_adapter)
end

#get_member_objectsObject

Provides operations to call the getMemberObjects method.



47
48
49
# File 'lib/devices/item/device_item_request_builder.rb', line 47

def get_member_objects()
    return MicrosoftGraph::Devices::Item::GetMemberObjects::GetMemberObjectsRequestBuilder.new(@path_parameters, @request_adapter)
end

#member_ofObject

Provides operations to manage the memberOf property of the microsoft.graph.device entity.



52
53
54
# File 'lib/devices/item/device_item_request_builder.rb', line 52

def member_of()
    return MicrosoftGraph::Devices::Item::MemberOf::MemberOfRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update the properties of a registered device. Only certain properties of a device can be updated through approved Mobile Device Managment (MDM) apps.

Raises:

Parameters:

  • The request body

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a Fiber of device



118
119
120
121
122
123
124
125
126
127
# File 'lib/devices/item/device_item_request_builder.rb', line 118

def patch(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = self.to_patch_request_information(
        body, request_configuration
    )
    error_mapping = Hash.new
    error_mapping["4XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    error_mapping["5XX"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }
    return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::Device.create_from_discriminator_value(pn) }, error_mapping)
end

#registered_ownersObject

Provides operations to manage the registeredOwners property of the microsoft.graph.device entity.



57
58
59
# File 'lib/devices/item/device_item_request_builder.rb', line 57

def registered_owners()
    return MicrosoftGraph::Devices::Item::RegisteredOwners::RegisteredOwnersRequestBuilder.new(@path_parameters, @request_adapter)
end

#registered_usersObject

Provides operations to manage the registeredUsers property of the microsoft.graph.device entity.



62
63
64
# File 'lib/devices/item/device_item_request_builder.rb', line 62

def registered_users()
    return MicrosoftGraph::Devices::Item::RegisteredUsers::RegisteredUsersRequestBuilder.new(@path_parameters, @request_adapter)
end

#restoreObject

Provides operations to call the restore method.



67
68
69
# File 'lib/devices/item/device_item_request_builder.rb', line 67

def restore()
    return MicrosoftGraph::Devices::Item::Restore::RestoreRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete a registered device.

Parameters:

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



133
134
135
136
137
138
139
140
141
142
143
# File 'lib/devices/item/device_item_request_builder.rb', line 133

def to_delete_request_information(request_configuration=nil)
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :DELETE
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.add_request_options(request_configuration.options)
    end
    return request_info
end

#to_get_request_information(request_configuration = nil) ⇒ Object

Get the properties and relationships of a device object.

Parameters:

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/devices/item/device_item_request_builder.rb', line 149

def to_get_request_information(request_configuration=nil)
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :GET
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.set_query_string_parameters_from_raw_object(request_configuration.query_parameters)
        request_info.add_request_options(request_configuration.options)
    end
    return request_info
end

#to_patch_request_information(body, request_configuration = nil) ⇒ Object

Update the properties of a registered device. Only certain properties of a device can be updated through approved Mobile Device Managment (MDM) apps.

Raises:

Parameters:

  • The request body

  • (defaults to: nil)

    Configuration for the request such as headers, query parameters, and middleware options.

Returns:

  • a request_information



168
169
170
171
172
173
174
175
176
177
178
179
180
181
# File 'lib/devices/item/device_item_request_builder.rb', line 168

def to_patch_request_information(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = MicrosoftKiotaAbstractions::RequestInformation.new()
    request_info.url_template = @url_template
    request_info.path_parameters = @path_parameters
    request_info.http_method = :PATCH
    request_info.headers.add('Accept', 'application/json')
    unless request_configuration.nil?
        request_info.add_headers_from_raw_object(request_configuration.headers)
        request_info.add_request_options(request_configuration.options)
    end
    request_info.set_content_from_parsable(@request_adapter, "application/json", body)
    return request_info
end

#transitive_member_ofObject

Provides operations to manage the transitiveMemberOf property of the microsoft.graph.device entity.



72
73
74
# File 'lib/devices/item/device_item_request_builder.rb', line 72

def transitive_member_of()
    return MicrosoftGraph::Devices::Item::TransitiveMemberOf::TransitiveMemberOfRequestBuilder.new(@path_parameters, @request_adapter)
end