Class: MicrosoftGraph::Teams::Item::Schedule::ScheduleRequestBuilder

Inherits:
MicrosoftKiotaAbstractions::BaseRequestBuilder
  • Object
show all
Defined in:
lib/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.



83
84
85
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 83

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

Instance Method Details

#delete(request_configuration = nil) ⇒ Object

Delete navigation property schedule for teams

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a Fiber of void



91
92
93
94
95
96
97
98
99
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 91

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



105
106
107
108
109
110
111
112
113
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 105

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.



29
30
31
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 29

def offer_shift_requests()
    return MicrosoftGraph::Teams::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.



34
35
36
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 34

def open_shift_change_requests()
    return MicrosoftGraph::Teams::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.



39
40
41
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 39

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

#put(body, request_configuration = nil) ⇒ Object

Update the navigation property schedule in teams

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)


120
121
122
123
124
125
126
127
128
129
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 120

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.



44
45
46
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 44

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

#shareObject

Provides operations to call the share method.



49
50
51
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 49

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

#shiftsObject

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



54
55
56
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 54

def shifts()
    return MicrosoftGraph::Teams::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.



59
60
61
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 59

def swap_shifts_change_requests()
    return MicrosoftGraph::Teams::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.



64
65
66
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 64

def time_off_reasons()
    return MicrosoftGraph::Teams::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.



69
70
71
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 69

def time_off_requests()
    return MicrosoftGraph::Teams::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.



74
75
76
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 74

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

#to_delete_request_information(request_configuration = nil) ⇒ Object

Delete navigation property schedule for teams

Parameters:

  • request_configuration (defaults to: nil)

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

Returns:

  • a request_information



135
136
137
138
139
140
141
142
143
144
145
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 135

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



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 151

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 teams

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)


170
171
172
173
174
175
176
177
178
179
180
181
182
183
# File 'lib/teams/item/schedule/schedule_request_builder.rb', line 170

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