Class: MicrosoftGraph::Sites::Item::SiteItemRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/sites/item/site_item_request_builder.rb

Overview

Provides operations to manage the collection of site entities.

Defined Under Namespace

Classes: SiteItemRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new SiteItemRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



126
127
128
# File 'lib/sites/item/site_item_request_builder.rb', line 126

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

Instance Method Details

#analyticsObject

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



37
38
39
# File 'lib/sites/item/site_item_request_builder.rb', line 37

def analytics()
    return MicrosoftGraph::Sites::Item::Analytics::AnalyticsRequestBuilder.new(@path_parameters, @request_adapter)
end

#columnsObject

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



42
43
44
# File 'lib/sites/item/site_item_request_builder.rb', line 42

def columns()
    return MicrosoftGraph::Sites::Item::Columns::ColumnsRequestBuilder.new(@path_parameters, @request_adapter)
end

#content_typesObject

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



47
48
49
# File 'lib/sites/item/site_item_request_builder.rb', line 47

def content_types()
    return MicrosoftGraph::Sites::Item::ContentTypes::ContentTypesRequestBuilder.new(@path_parameters, @request_adapter)
end

#created_by_userObject

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



52
53
54
# File 'lib/sites/item/site_item_request_builder.rb', line 52

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

#driveObject

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



57
58
59
# File 'lib/sites/item/site_item_request_builder.rb', line 57

def drive()
    return MicrosoftGraph::Sites::Item::Drive::DriveRequestBuilder.new(@path_parameters, @request_adapter)
end

#drivesObject

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



62
63
64
# File 'lib/sites/item/site_item_request_builder.rb', line 62

def drives()
    return MicrosoftGraph::Sites::Item::Drives::DrivesRequestBuilder.new(@path_parameters, @request_adapter)
end

#external_columnsObject

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



67
68
69
# File 'lib/sites/item/site_item_request_builder.rb', line 67

def external_columns()
    return MicrosoftGraph::Sites::Item::ExternalColumns::ExternalColumnsRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

Retrieve properties and relationships for a [site][] resource.A site resource represents a team site in SharePoint.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of site



134
135
136
137
138
139
140
141
142
# File 'lib/sites/item/site_item_request_builder.rb', line 134

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

#get_activities_by_intervalObject

Provides operations to call the getActivitiesByInterval method.



72
73
74
# File 'lib/sites/item/site_item_request_builder.rb', line 72

def get_activities_by_interval()
    return MicrosoftGraph::Sites::Item::GetActivitiesByInterval::GetActivitiesByIntervalRequestBuilder.new(@path_parameters, @request_adapter)
end

#get_activities_by_interval_with_start_date_time_with_end_date_time_with_interval(end_date_time, interval, start_date_time) ⇒ Object

Provides operations to call the getActivitiesByInterval method.

Parameters:

  • end_date_time

    Usage: endDateTime='endDateTime'

  • interval

    Usage: interval='interval'

  • start_date_time

    Usage: startDateTime='startDateTime'

Returns:

  • a get_activities_by_interval_with_start_date_time_with_end_date_time_with_interval_request_builder

Raises:

  • (StandardError)


150
151
152
153
154
155
# File 'lib/sites/item/site_item_request_builder.rb', line 150

def get_activities_by_interval_with_start_date_time_with_end_date_time_with_interval(end_date_time, interval, start_date_time)
    raise StandardError, 'end_date_time cannot be null' if end_date_time.nil?
    raise StandardError, 'interval cannot be null' if interval.nil?
    raise StandardError, 'start_date_time cannot be null' if start_date_time.nil?
    return GetActivitiesByIntervalWithStartDateTimeWithEndDateTimeWithIntervalRequestBuilder.new(@path_parameters, @request_adapter, endDateTime, interval, startDateTime)
end

#get_applicable_content_types_for_list_with_list_id(list_id) ⇒ Object

Provides operations to call the getApplicableContentTypesForList method.

Parameters:

  • list_id

    Usage: listId='listId'

Returns:

  • a get_applicable_content_types_for_list_with_list_id_request_builder

Raises:

  • (StandardError)


161
162
163
164
# File 'lib/sites/item/site_item_request_builder.rb', line 161

def get_applicable_content_types_for_list_with_list_id(list_id)
    raise StandardError, 'list_id cannot be null' if list_id.nil?
    return GetApplicableContentTypesForListWithListIdRequestBuilder.new(@path_parameters, @request_adapter, listId)
end

#get_by_path_with_path(path) ⇒ Object

Provides operations to call the getByPath method.

Parameters:

  • path

    Usage: path='path'

Returns:

  • a get_by_path_with_path_request_builder

Raises:

  • (StandardError)


170
171
172
173
# File 'lib/sites/item/site_item_request_builder.rb', line 170

def get_by_path_with_path(path)
    raise StandardError, 'path cannot be null' if path.nil?
    return GetByPathWithPathRequestBuilder.new(@path_parameters, @request_adapter, path)
end

#itemsObject

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



77
78
79
# File 'lib/sites/item/site_item_request_builder.rb', line 77

def items()
    return MicrosoftGraph::Sites::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.



82
83
84
# File 'lib/sites/item/site_item_request_builder.rb', line 82

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

#listsObject

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



87
88
89
# File 'lib/sites/item/site_item_request_builder.rb', line 87

def lists()
    return MicrosoftGraph::Sites::Item::Lists::ListsRequestBuilder.new(@path_parameters, @request_adapter)
end

#onenoteObject

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



92
93
94
# File 'lib/sites/item/site_item_request_builder.rb', line 92

def onenote()
    return MicrosoftGraph::Sites::Item::Onenote::OnenoteRequestBuilder.new(@path_parameters, @request_adapter)
end

#operationsObject

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



97
98
99
# File 'lib/sites/item/site_item_request_builder.rb', line 97

def operations()
    return MicrosoftGraph::Sites::Item::Operations::OperationsRequestBuilder.new(@path_parameters, @request_adapter)
end

#patch(body, request_configuration = nil) ⇒ Object

Update entity in sites

Parameters:

  • body

    The request body

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of site

Raises:

  • (StandardError)


180
181
182
183
184
185
186
187
188
189
# File 'lib/sites/item/site_item_request_builder.rb', line 180

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

#permissionsObject

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



102
103
104
# File 'lib/sites/item/site_item_request_builder.rb', line 102

def permissions()
    return MicrosoftGraph::Sites::Item::Permissions::PermissionsRequestBuilder.new(@path_parameters, @request_adapter)
end

#sitesObject

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



107
108
109
# File 'lib/sites/item/site_item_request_builder.rb', line 107

def sites()
    return MicrosoftGraph::Sites::Item::Sites::SitesRequestBuilder.new(@path_parameters, @request_adapter)
end

#term_storeObject

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



112
113
114
# File 'lib/sites/item/site_item_request_builder.rb', line 112

def term_store()
    return MicrosoftGraph::Sites::Item::TermStore::TermStoreRequestBuilder.new(@path_parameters, @request_adapter)
end

#term_storesObject

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



117
118
119
# File 'lib/sites/item/site_item_request_builder.rb', line 117

def term_stores()
    return MicrosoftGraph::Sites::Item::TermStores::TermStoresRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_get_request_information(request_configuration = nil) ⇒ Object

Retrieve properties and relationships for a [site][] resource.A site resource represents a team site in SharePoint.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/sites/item/site_item_request_builder.rb', line 195

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 sites

Parameters:

  • body

    The request body

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information

Raises:

  • (StandardError)


214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/sites/item/site_item_request_builder.rb', line 214

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