Class: MicrosoftGraph::Shares::Item::SharedDriveItemItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/shares/item/shared_drive_item_item_request_builder.rb

Overview

Provides operations to manage the collection of sharedDriveItem entities.

Defined Under Namespace

Classes: SharedDriveItemItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new SharedDriveItemItemRequestBuilder and sets the default values.

Parameters:

  • Path parameters for the request

  • The request adapter to use to execute the requests.



75
76
77
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 75

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

Instance Method Details

#created_by_userObject

Provides operations to manage the createdByUser property of the microsoft.graph.baseItem entity.



26
27
28
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 26

def created_by_user()
    return MicrosoftGraph::Shares::Item::CreatedByUser::CreatedByUserRequestBuilder.new(@path_parameters, @request_adapter)
end

#delete(request_configuration = nil) ⇒ Object

Delete entity from shares

Parameters:

  • (defaults to: nil)

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

Returns:

  • a Fiber of void



83
84
85
86
87
88
89
90
91
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 83

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

#drive_itemObject

Provides operations to manage the driveItem property of the microsoft.graph.sharedDriveItem entity.



31
32
33
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 31

def drive_item()
    return MicrosoftGraph::Shares::Item::DriveItem::DriveItemRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

Access a shared DriveItem or a collection of shared items by using a shareId or sharing URL. To use a sharing URL with this API, your app needs to transform the URL into a sharing token.

Parameters:

  • (defaults to: nil)

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

Returns:

  • a Fiber of shared_drive_item



97
98
99
100
101
102
103
104
105
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 97

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::SharedDriveItem.create_from_discriminator_value(pn) }, error_mapping)
end

#itemsObject

Provides operations to manage the items property of the microsoft.graph.sharedDriveItem entity.



36
37
38
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 36

def items()
    return MicrosoftGraph::Shares::Item::Items::ItemsRequestBuilder.new(@path_parameters, @request_adapter)
end

#last_modified_by_userObject

Provides operations to manage the lastModifiedByUser property of the microsoft.graph.baseItem entity.



41
42
43
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 41

def last_modified_by_user()
    return MicrosoftGraph::Shares::Item::LastModifiedByUser::LastModifiedByUserRequestBuilder.new(@path_parameters, @request_adapter)
end

#listObject

Provides operations to manage the list property of the microsoft.graph.sharedDriveItem entity.



46
47
48
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 46

def list()
    return MicrosoftGraph::Shares::Item::List::ListRequestBuilder.new(@path_parameters, @request_adapter)
end

#list_itemObject

Provides operations to manage the listItem property of the microsoft.graph.sharedDriveItem entity.



51
52
53
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 51

def list_item()
    return MicrosoftGraph::Shares::Item::ListItem::ListItemRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update entity in shares

Parameters:

  • The request body

  • (defaults to: nil)

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

Returns:

  • a Fiber of shared_drive_item

Raises:



112
113
114
115
116
117
118
119
120
121
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 112

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::SharedDriveItem.create_from_discriminator_value(pn) }, error_mapping)
end

#permissionObject

Provides operations to manage the permission property of the microsoft.graph.sharedDriveItem entity.



56
57
58
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 56

def permission()
    return MicrosoftGraph::Shares::Item::Permission::PermissionRequestBuilder.new(@path_parameters, @request_adapter)
end

#rootObject

Provides operations to manage the root property of the microsoft.graph.sharedDriveItem entity.



61
62
63
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 61

def root()
    return MicrosoftGraph::Shares::Item::Root::RootRequestBuilder.new(@path_parameters, @request_adapter)
end

#siteObject

Provides operations to manage the site property of the microsoft.graph.sharedDriveItem entity.



66
67
68
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 66

def site()
    return MicrosoftGraph::Shares::Item::Site::SiteRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete entity from shares

Parameters:

  • (defaults to: nil)

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

Returns:

  • a request_information



127
128
129
130
131
132
133
134
135
136
137
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 127

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

Access a shared DriveItem or a collection of shared items by using a shareId or sharing URL. To use a sharing URL with this API, your app needs to transform the URL into a sharing token.

Parameters:

  • (defaults to: nil)

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

Returns:

  • a request_information



143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 143

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 entity in shares

Parameters:

  • The request body

  • (defaults to: nil)

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

Returns:

  • a request_information

Raises:



162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/shares/item/shared_drive_item_item_request_builder.rb', line 162

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