Class: Rixl::Images::ImagesRequestBuilder
- Inherits:
-
MicrosoftKiotaAbstractions::BaseRequestBuilder
- Object
- MicrosoftKiotaAbstractions::BaseRequestBuilder
- Rixl::Images::ImagesRequestBuilder
- Defined in:
- lib/images/images_request_builder.rb
Overview
Builds and executes requests for operations under images
Defined Under Namespace
Classes: ImagesRequestBuilderGetQueryParameters
Instance Method Summary collapse
-
#by_image_id(image_id) ⇒ Object
Gets an item from the rixl.images.item collection.
-
#get(request_configuration = nil) ⇒ Object
Retrieve all images for a specific project, with pagination and sorting.
-
#initialize(path_parameters, request_adapter) ⇒ Object
constructor
Instantiates a new ImagesRequestBuilder and sets the default values.
-
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve all images for a specific project, with pagination and sorting.
-
#upload ⇒ Object
The upload property.
-
#with_url(raw_url) ⇒ Object
Returns a request builder with the provided arbitrary URL.
Constructor Details
#initialize(path_parameters, request_adapter) ⇒ Object
Instantiates a new ImagesRequestBuilder and sets the default values.
37 38 39 |
# File 'lib/images/images_request_builder.rb', line 37 def initialize(path_parameters, request_adapter) super(path_parameters, request_adapter, "{+baseurl}/images{?limit*,offset*,order*,sort*}") end |
Instance Method Details
#by_image_id(image_id) ⇒ Object
Gets an item from the rixl.images.item collection
25 26 27 28 29 30 |
# File 'lib/images/images_request_builder.rb', line 25 def by_image_id(image_id) raise StandardError, 'image_id cannot be null' if image_id.nil? url_tpl_params = @path_parameters.clone url_tpl_params["imageId"] = image_id return Rixl::Images::Item::WithImageItemRequestBuilder.new(url_tpl_params, @request_adapter) end |
#get(request_configuration = nil) ⇒ Object
Retrieve all images for a specific project, with pagination and sorting.
45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/images/images_request_builder.rb', line 45 def get(request_configuration=nil) request_info = self.to_get_request_information( request_configuration ) error_mapping = Hash.new error_mapping["400"] = lambda {|pn| Rixl::Models::Github_com_rixlhq_api_internal_errorsErrorResponse.create_from_discriminator_value(pn) } error_mapping["401"] = lambda {|pn| Rixl::Models::Github_com_rixlhq_api_internal_errorsErrorResponse.create_from_discriminator_value(pn) } error_mapping["403"] = lambda {|pn| Rixl::Models::Github_com_rixlhq_api_internal_errorsErrorResponse.create_from_discriminator_value(pn) } error_mapping["500"] = lambda {|pn| Rixl::Models::Github_com_rixlhq_api_internal_errorsErrorResponse.create_from_discriminator_value(pn) } return @request_adapter.send_async(request_info, lambda {|pn| Rixl::Models::PaginationPaginatedResponseImage.create_from_discriminator_value(pn) }, error_mapping) end |
#to_get_request_information(request_configuration = nil) ⇒ Object
Retrieve all images for a specific project, with pagination and sorting.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/images/images_request_builder.rb', line 61 def to_get_request_information(request_configuration=nil) request_info = MicrosoftKiotaAbstractions::RequestInformation.new() 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 request_info.url_template = @url_template request_info.path_parameters = @path_parameters request_info.http_method = :GET request_info.headers.try_add('Accept', 'application/json') return request_info end |
#upload ⇒ Object
The upload property
17 18 19 |
# File 'lib/images/images_request_builder.rb', line 17 def upload() return Rixl::Images::Upload::UploadRequestBuilder.new(@path_parameters, @request_adapter) end |
#with_url(raw_url) ⇒ Object
Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored.
79 80 81 82 |
# File 'lib/images/images_request_builder.rb', line 79 def with_url(raw_url) raise StandardError, 'raw_url cannot be null' if raw_url.nil? return ImagesRequestBuilder.new(raw_url, @request_adapter) end |