Class: MicrosoftGraph::SchemaExtensions::Item::SchemaExtensionItemRequestBuilder
- Inherits:
-
MicrosoftKiotaAbstractions::BaseRequestBuilder
- Object
- MicrosoftKiotaAbstractions::BaseRequestBuilder
- MicrosoftGraph::SchemaExtensions::Item::SchemaExtensionItemRequestBuilder
- Defined in:
- lib/schema_extensions/item/schema_extension_item_request_builder.rb
Overview
Provides operations to manage the collection of schemaExtension entities.
Defined Under Namespace
Classes: SchemaExtensionItemRequestBuilderGetQueryParameters
Instance Method Summary collapse
-
#delete(request_configuration = nil) ⇒ Object
Delete the definition of a schema extension.
-
#get(request_configuration = nil) ⇒ Object
Get schemaExtension.
-
#initialize(path_parameters, request_adapter) ⇒ Object
constructor
Instantiates a new SchemaExtensionItemRequestBuilder and sets the default values.
-
#patch(body, request_configuration = nil) ⇒ Object
Update properties in the definition of the specified schemaExtension.
-
#to_delete_request_information(request_configuration = nil) ⇒ Object
Delete the definition of a schema extension.
-
#to_get_request_information(request_configuration = nil) ⇒ Object
Get schemaExtension.
-
#to_patch_request_information(body, request_configuration = nil) ⇒ Object
Update properties in the definition of the specified schemaExtension.
Constructor Details
#initialize(path_parameters, request_adapter) ⇒ Object
Instantiates a new SchemaExtensionItemRequestBuilder and sets the default values.
21 22 23 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 21 def initialize(path_parameters, request_adapter) super(path_parameters, request_adapter, "{+baseurl}/schemaExtensions/{schemaExtension%2Did}{?%24select,%24expand}") end |
Instance Method Details
#delete(request_configuration = nil) ⇒ Object
Delete the definition of a schema extension. Only the app that created the schema extension (owner app) can delete the schema extension definition, and only when the extension is in the InDevelopment state. Deleting a schema extension definition does not affect accessing custom data that has been added to resource instances based on that definition.
29 30 31 32 33 34 35 36 37 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 29 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 |
#get(request_configuration = nil) ⇒ Object
Get schemaExtension
43 44 45 46 47 48 49 50 51 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 43 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::SchemaExtension.create_from_discriminator_value(pn) }, error_mapping) end |
#patch(body, request_configuration = nil) ⇒ Object
Update properties in the definition of the specified schemaExtension. Additive updates to the extension can only be made when the extension is in the InDevelopment or Available status. This means custom properties or target resource types cannot be removed from the definition, but new custom properties can be added and the description of the extension changed. The update applies to all the resources that are included in the targetTypes property of the extension. These resources are among the supporting resource types. For delegated flows, the signed-in user can update a schema extension as long as the owner property of the extension is set to the appId of an application the signed-in user owns. That application can be the one that initially created the extension, or some other application owned by the signed-in user. This criteria for the owner property allows a signed-in user to make updates through other applications they don’t own, such as Microsoft Graph Explorer. When using Graph Explorer to update a schemaExtension resource, include the owner property in the PATCH request body.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 58 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::SchemaExtension.create_from_discriminator_value(pn) }, error_mapping) end |
#to_delete_request_information(request_configuration = nil) ⇒ Object
Delete the definition of a schema extension. Only the app that created the schema extension (owner app) can delete the schema extension definition, and only when the extension is in the InDevelopment state. Deleting a schema extension definition does not affect accessing custom data that has been added to resource instances based on that definition.
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 73 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.(request_configuration.) end return request_info end |
#to_get_request_information(request_configuration = nil) ⇒ Object
Get schemaExtension
89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 89 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.(request_configuration.) end return request_info end |
#to_patch_request_information(body, request_configuration = nil) ⇒ Object
Update properties in the definition of the specified schemaExtension. Additive updates to the extension can only be made when the extension is in the InDevelopment or Available status. This means custom properties or target resource types cannot be removed from the definition, but new custom properties can be added and the description of the extension changed. The update applies to all the resources that are included in the targetTypes property of the extension. These resources are among the supporting resource types. For delegated flows, the signed-in user can update a schema extension as long as the owner property of the extension is set to the appId of an application the signed-in user owns. That application can be the one that initially created the extension, or some other application owned by the signed-in user. This criteria for the owner property allows a signed-in user to make updates through other applications they don’t own, such as Microsoft Graph Explorer. When using Graph Explorer to update a schemaExtension resource, include the owner property in the PATCH request body.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/schema_extensions/item/schema_extension_item_request_builder.rb', line 108 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.(request_configuration.) end request_info.set_content_from_parsable(@request_adapter, "application/json", body) return request_info end |