Class: Rixl::Videos::VideosRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/videos/videos_request_builder.rb

Overview

Builds and executes requests for operations under videos

Defined Under Namespace

Classes: VideosRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new VideosRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



43
44
45
# File 'lib/videos/videos_request_builder.rb', line 43

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/videos{?limit*,offset*,order*,sort*}")
end

Instance Method Details

#by_video_id(video_id) ⇒ Object

Gets an item from the rixl.videos.item collection

Parameters:

  • video_id

    Video ID

Returns:

  • a with_video_item_request_builder

Raises:

  • (StandardError)


31
32
33
34
35
36
# File 'lib/videos/videos_request_builder.rb', line 31

def by_video_id(video_id)
    raise StandardError, 'video_id cannot be null' if video_id.nil?
    url_tpl_params = @path_parameters.clone
    url_tpl_params["videoId"] = video_id
    return Rixl::Videos::Item::WithVideoItemRequestBuilder.new(url_tpl_params, @request_adapter)
end

#get(request_configuration = nil) ⇒ Object

Retrieve all videos for a specific project, with pagination and sorting.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of pagination_paginated_response_video



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/videos/videos_request_builder.rb', line 51

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

#languagesObject

The languages property



18
19
20
# File 'lib/videos/videos_request_builder.rb', line 18

def languages()
    return Rixl::Videos::Languages::LanguagesRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_get_request_information(request_configuration = nil) ⇒ Object

Retrieve all videos for a specific project, with pagination and sorting.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/videos/videos_request_builder.rb', line 67

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.add_request_options(request_configuration.options)
    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

#uploadObject

The upload property



23
24
25
# File 'lib/videos/videos_request_builder.rb', line 23

def upload()
    return Rixl::Videos::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.

Parameters:

  • raw_url

    The raw URL to use for the request builder.

Returns:

  • a videos_request_builder

Raises:

  • (StandardError)


85
86
87
88
# File 'lib/videos/videos_request_builder.rb', line 85

def with_url(raw_url)
    raise StandardError, 'raw_url cannot be null' if raw_url.nil?
    return VideosRequestBuilder.new(raw_url, @request_adapter)
end