Class: MicrosoftGraph::Me::JoinedTeams::Item::Schedule::ScheduleRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/me/joined_teams/item/schedule/schedule_request_builder.rb

Overview

Provides operations to manage the schedule property of the microsoft.graph.team entity.

Defined Under Namespace

Classes: ScheduleRequestBuilderGetQueryParameters

Instance Method Summary collapse

Constructor Details

#initialize(path_parameters, request_adapter) ⇒ Object

Instantiates a new ScheduleRequestBuilder and sets the default values.

Parameters:

  • path_parameters

    Path parameters for the request

  • request_adapter

    The request adapter to use to execute the requests.



85
86
87
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 85

def initialize(path_parameters, request_adapter)
    super(path_parameters, request_adapter, "{+baseurl}/me/joinedTeams/{team%2Did}/schedule{?%24select,%24expand}")
end

Instance Method Details

#delete(request_configuration = nil) ⇒ Object

Delete navigation property schedule for me

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of void



93
94
95
96
97
98
99
100
101
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 93

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

Retrieve the properties and relationships of a schedule object. The schedule creation process conforms to the One API guideline for resource based long running operations (RELO).When clients use the PUT method, if the schedule is provisioned, the operation updates the schedule; otherwise, the operation starts the schedule provisioning process in the background. During schedule provisioning, clients can use the GET method to get the schedule and look at the provisionStatus property for the current state of the provisioning. If the provisioning failed, clients can get additional information from the provisionStatusCode property. Clients can also inspect the configuration of the schedule.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of schedule



107
108
109
110
111
112
113
114
115
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 107

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

#offer_shift_requestsObject

Provides operations to manage the offerShiftRequests property of the microsoft.graph.schedule entity.



31
32
33
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 31

def offer_shift_requests()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::OfferShiftRequests::OfferShiftRequestsRequestBuilder.new(@path_parameters, @request_adapter)
end

#open_shift_change_requestsObject

Provides operations to manage the openShiftChangeRequests property of the microsoft.graph.schedule entity.



36
37
38
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 36

def open_shift_change_requests()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::OpenShiftChangeRequests::OpenShiftChangeRequestsRequestBuilder.new(@path_parameters, @request_adapter)
end

#open_shiftsObject

Provides operations to manage the openShifts property of the microsoft.graph.schedule entity.



41
42
43
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 41

def open_shifts()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::OpenShifts::OpenShiftsRequestBuilder.new(@path_parameters, @request_adapter)
end

#put(body, request_configuration = nil) ⇒ Object

Update the navigation property schedule in me

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 schedule

Raises:

  • (StandardError)


122
123
124
125
126
127
128
129
130
131
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 122

def put(body, request_configuration=nil)
    raise StandardError, 'body cannot be null' if body.nil?
    request_info = self.to_put_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::Schedule.create_from_discriminator_value(pn) }, error_mapping)
end

#scheduling_groupsObject

Provides operations to manage the schedulingGroups property of the microsoft.graph.schedule entity.



46
47
48
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 46

def scheduling_groups()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::SchedulingGroups::SchedulingGroupsRequestBuilder.new(@path_parameters, @request_adapter)
end

#shareObject

Provides operations to call the share method.



51
52
53
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 51

def share()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::Share::ShareRequestBuilder.new(@path_parameters, @request_adapter)
end

#shiftsObject

Provides operations to manage the shifts property of the microsoft.graph.schedule entity.



56
57
58
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 56

def shifts()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::Shifts::ShiftsRequestBuilder.new(@path_parameters, @request_adapter)
end

#swap_shifts_change_requestsObject

Provides operations to manage the swapShiftsChangeRequests property of the microsoft.graph.schedule entity.



61
62
63
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 61

def swap_shifts_change_requests()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::SwapShiftsChangeRequests::SwapShiftsChangeRequestsRequestBuilder.new(@path_parameters, @request_adapter)
end

#time_off_reasonsObject

Provides operations to manage the timeOffReasons property of the microsoft.graph.schedule entity.



66
67
68
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 66

def time_off_reasons()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::TimeOffReasons::TimeOffReasonsRequestBuilder.new(@path_parameters, @request_adapter)
end

#time_off_requestsObject

Provides operations to manage the timeOffRequests property of the microsoft.graph.schedule entity.



71
72
73
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 71

def time_off_requests()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::TimeOffRequests::TimeOffRequestsRequestBuilder.new(@path_parameters, @request_adapter)
end

#times_offObject

Provides operations to manage the timesOff property of the microsoft.graph.schedule entity.



76
77
78
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 76

def times_off()
    return MicrosoftGraph::Me::JoinedTeams::Item::Schedule::TimesOff::TimesOffRequestBuilder.new(@path_parameters, @request_adapter)
end

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete navigation property schedule for me

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



137
138
139
140
141
142
143
144
145
146
147
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 137

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

Retrieve the properties and relationships of a schedule object. The schedule creation process conforms to the One API guideline for resource based long running operations (RELO).When clients use the PUT method, if the schedule is provisioned, the operation updates the schedule; otherwise, the operation starts the schedule provisioning process in the background. During schedule provisioning, clients can use the GET method to get the schedule and look at the provisionStatus property for the current state of the provisioning. If the provisioning failed, clients can get additional information from the provisionStatusCode property. Clients can also inspect the configuration of the schedule.

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 153

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_put_request_information(body, request_configuration = nil) ⇒ Object

Update the navigation property schedule in me

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)


172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/me/joined_teams/item/schedule/schedule_request_builder.rb', line 172

def to_put_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 = :PUT
    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