Class: MicrosoftGraph::Drives::Item::Items::Item::Workbook::WorkbookRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/drives/item/items/item/workbook/workbook_request_builder.rb

Overview

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

Defined Under Namespace

Classes: WorkbookRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new WorkbookRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



89
90
91
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 89

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/drives/{drive%2Did}/items/{driveItem%2Did}/workbook{?%24select,%24expand}")
end

Instance Method Details

#applicationObject

Provides operations to manage the application property of the microsoft.graph.workbook entity.



35
36
37
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 35

def application()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Application::ApplicationRequestBuilder.new(@path_parameters, @request_adapter)
end

#close_sessionObject

Provides operations to call the closeSession method.



40
41
42
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 40

def close_session()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::CloseSession::CloseSessionRequestBuilder.new(@path_parameters, @request_adapter)
end

#commentsObject

Provides operations to manage the comments property of the microsoft.graph.workbook entity.



45
46
47
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 45

def comments()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Comments::CommentsRequestBuilder.new(@path_parameters, @request_adapter)
end

#create_sessionObject

Provides operations to call the createSession method.



50
51
52
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 50

def create_session()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::CreateSession::CreateSessionRequestBuilder.new(@path_parameters, @request_adapter)
end

#delete(request_configuration = nil) ⇒ Object

Delete navigation property workbook for drives

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of void



97
98
99
100
101
102
103
104
105
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 97

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

#functionsObject

Provides operations to manage the functions property of the microsoft.graph.workbook entity.



55
56
57
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 55

def functions()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::FunctionsRequestBuilder.new(@path_parameters, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet’s contents. Nullable.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of workbook



111
112
113
114
115
116
117
118
119
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 111

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

#namesObject

Provides operations to manage the names property of the microsoft.graph.workbook entity.



60
61
62
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 60

def names()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Names::NamesRequestBuilder.new(@path_parameters, @request_adapter)
end

#operationsObject

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



65
66
67
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 65

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

#patch(body, request_configuration = nil) ⇒ Object

Update the navigation property workbook in drives

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 workbook

Raises:

  • (StandardError)


126
127
128
129
130
131
132
133
134
135
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 126

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

#refresh_sessionObject

Provides operations to call the refreshSession method.



70
71
72
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 70

def refresh_session()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::RefreshSession::RefreshSessionRequestBuilder.new(@path_parameters, @request_adapter)
end

#session_info_resource_with_key(key) ⇒ Object

Provides operations to call the sessionInfoResource method.

Parameters:

  • key

    Usage: key=‘key’

Returns:

  • a session_info_resource_with_key_request_builder

Raises:

  • (StandardError)


141
142
143
144
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 141

def session_info_resource_with_key(key)
    raise StandardError, 'key cannot be null' if key.nil?
    return SessionInfoResourceWithKeyRequestBuilder.new(@path_parameters, @request_adapter, key)
end

#table_row_operation_result_with_key(key) ⇒ Object

Provides operations to call the tableRowOperationResult method.

Parameters:

  • key

    Usage: key=‘key’

Returns:

  • a table_row_operation_result_with_key_request_builder

Raises:

  • (StandardError)


150
151
152
153
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 150

def table_row_operation_result_with_key(key)
    raise StandardError, 'key cannot be null' if key.nil?
    return TableRowOperationResultWithKeyRequestBuilder.new(@path_parameters, @request_adapter, key)
end

#tablesObject

Provides operations to manage the tables property of the microsoft.graph.workbook entity.



75
76
77
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 75

def tables()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Tables::TablesRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete navigation property workbook for drives

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



159
160
161
162
163
164
165
166
167
168
169
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 159

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

For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet’s contents. Nullable.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 175

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 navigation property workbook in drives

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)


194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 194

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

#worksheetsObject

Provides operations to manage the worksheets property of the microsoft.graph.workbook entity.



80
81
82
# File 'lib/drives/item/items/item/workbook/workbook_request_builder.rb', line 80

def worksheets()
    return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Worksheets::WorksheetsRequestBuilder.new(@path_parameters, @request_adapter)
end