/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the License);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
namespace Tizen.Network.IoTConnectivity
{
///
/// Class respresenting request to a resource.
/// It provides APIs to manage client's request.
///
/// 3
public class Request : IDisposable
{
private bool _disposed = false;
internal Request()
{
}
///
/// Destructor of the Request class.
///
~Request()
{
Dispose(false);
}
///
/// The host address of the request.
///
/// 3
/// The host address of the request.
public string HostAddress { get; internal set; }
///
/// The representation of the request.
///
/// 3
/// The representation of the request.
public Representation Representation { get; internal set; }
///
/// The query of the request.
///
/// 3
/// The query of the request.
public ResourceQuery Query { get; internal set; }
///
/// The options related to the request.
///
/// 3
/// The options related to the request.
public ResourceOptions Options { get; internal set; }
///
/// Releases any unmanaged resources used by this object.
///
/// 3
/// http://tizen.org/feature/iot.ocf
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
///
/// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects.
///
/// 3
/// If true, disposes any disposable objects. If false, does not dispose disposable objects.
/// http://tizen.org/feature/iot.ocf
protected virtual void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
Representation?.Dispose();
Query?.Dispose();
Options?.Dispose();
}
_disposed = true;
}
}
}